• 締切済み

Linuxの終了時実行がしたい

fedora 21 beta(3.17.4-301.fc21.x86_64) です 以前までhaltに直接追記して運用していたのですが systemd絡みでしょうか?haltの呼び出し元らしい物が見当たりません どの様にしたら良いでしょうか 参考ログ # find / -name halt /usr/sbin/halt /sys/fs/selinux/class/system/perms/halt # find / -name shutdown /run/systemd/shutdown /usr/sbin/shutdown /sys/fs/selinux/class/tun_socket/perms/shutdown /sys/fs/selinux/class/dccp_socket/perms/shutdown /sys/fs/selinux/class/appletalk_socket/perms/shutdown /sys/fs/selinux/class/netlink_kobject_uevent_socket/perms/shutdown /sys/fs/selinux/class/netlink_dnrt_socket/perms/shutdown /sys/fs/selinux/class/netlink_ip6fw_socket/perms/shutdown /sys/fs/selinux/class/netlink_audit_socket/perms/shutdown /sys/fs/selinux/class/netlink_selinux_socket/perms/shutdown /sys/fs/selinux/class/netlink_xfrm_socket/perms/shutdown /sys/fs/selinux/class/netlink_nflog_socket/perms/shutdown /sys/fs/selinux/class/netlink_tcpdiag_socket/perms/shutdown /sys/fs/selinux/class/netlink_firewall_socket/perms/shutdown /sys/fs/selinux/class/netlink_route_socket/perms/shutdown /sys/fs/selinux/class/unix_dgram_socket/perms/shutdown /sys/fs/selinux/class/unix_stream_socket/perms/shutdown /sys/fs/selinux/class/key_socket/perms/shutdown /sys/fs/selinux/class/packet_socket/perms/shutdown /sys/fs/selinux/class/netlink_socket/perms/shutdown /sys/fs/selinux/class/rawip_socket/perms/shutdown /sys/fs/selinux/class/udp_socket/perms/shutdown /sys/fs/selinux/class/tcp_socket/perms/shutdown /sys/fs/selinux/class/socket/perms/shutdown

みんなの回答

  • anmochi
  • ベストアンサー率65% (1332/2045)
回答No.2

いい感じです。ちょっとだけサービスを直してみましょう。/etc/systemd/system/myshutdownscript.serviceを以下のようにしてみてください。 ~~~~ここから~~~~ [Unit] Description=myshutdownscript Before=poweroff.target reboot.target DefaultDependencies=no [Service] ExecStart=/myshutdownscript.sh Type=oneshot RemainAfterExit=yes [Install] WantedBy=poweroff.target reboot.target ~~~~ここまで~~~~ このサービスのポイントは ・poweroff.targetに依存され(Wanted)てかつpoweroff.targetの前(Before)に実行する。 ・reboot.targetに依存され(Wanted)てかつreboot.targetの前(Before)に実行する。 ・DefaultDependenciesをnoにする(本家サイトではfalseにしろってなってるけどどっちがいいのだろう)。 ・一度だけ実行(Type=oneshot)して、終了後も失敗扱いにしない(RemainAfterExit=yes)。 依存に関しては手動でリンクを張れば必要ないけど、依存関係(Wanted)を指定しておくと # systemctl enable myshutdownscript.service で/etc/systemd/system/poweroff.target.wantsとshutdown.target.wantsに勝手にリンクがはられるようになる。 # systemctl disable myshutdownscript.service でリンクが消されるのも自動というかsystemdのお作法にのっとったものになる。

  • anmochi
  • ベストアンサー率65% (1332/2045)
回答No.1

試してないけどsystemd的には以下の方法でいけるはず。 適当なスクリプトを作って(例:/etc/myshutdownscript.sh)、 それを一度だけ実行するserviceを作り(Type=oneshotとかRemainAfterExit=yesとかで検索)、 ロードして(#systemctl load /lib/systemd/system/runmyshutdownscript.serviceみたいな)、 poweroff.target.wantsとreboot.target.wantsとhalt.target.wantsに入れる(シンボリックリンクを張る)。

popepon
質問者

お礼

ご回答有難うございます 参考にスクリプトを作成しましたが実行されてないみたいです 参考ログ ------------------------ [root@localhost linux]# ls -l /usr/lib/systemd/system/poweroff.target.wants/ 合計 0 lrwxrwxrwx 1 root root 34 12月 14 10:46 myshutdownscript.service -> /etc/systemd/system/myshutdownscript.service lrwxrwxrwx. 1 root root 28 8月 18 14:16 plymouth-poweroff.service -> ../plymouth-poweroff.service lrwxrwxrwx 1 root root 39 11月 27 23:07 systemd-update-utmp-runlevel.service -> ../systemd-update-utmp-runlevel.service ------------------------ [root@localhost linux]# cat /etc/systemd/system/myshutdownscript.service [Unit] Description=myshutdownscript After=network.target [Service] ExecStart=/myshutdownscript.sh Type=oneshot RemainAfterExit=yes ExecStop=/bin/kill -TERM $MAINPID [Install] WantedBy=multi-user.target ------------------------ [root@localhost Linux]# cat /myshutdownscript.sh #!/bin/bash mkdir /seikou ------------------------ [root@localhost linux]# ls -l /myshutdownscript.sh -rwxr-xr-x 1 root root 267 12月 15 06:33 /myshutdownscript.sh

関連するQ&A

  • Solarisでshutdownコマンド使えない

    Solarisでshutdownコマンドが使えません (rebootやhaltはできます) どうしてもshutdownコマンドを使用してシステムを停止したいのですが、cannot createのエラーになり シャットダウンできません。(rebootやhaltはできます) shutdownコマンドが使えない原因とエラー解消方法について教えて頂きたいです。 bash-2.05# shutdown /usr/sbin/shutdown: /tmp/sh1370: cannot create bash-2.05# less cat /tmp/sh1370 cat: cannot open /tmp/sh1370    →ファイルなし bash-2.05# chmod -Rf 753 /tmp bash-2.05# shutdown /usr/sbin/shutdown: /tmp/sh1400: cannot create

  • solarisのmakeについて

    こんにちは。教えて下さい。 solaris7にperl5.6.1をインストールしようとしている所です。 ./configuerを実行したあと、makeをしないといけないようなのですが、 make とやると、「見つかりません」と言われてしまいます。 PATHが通ってないのかと思い、echo$PATH とやると /usr/bin:/usr/sbinと出てきます。 で、ここでmakeを探したのですが見あたらなかったので、 find / -name make としてやると、 /usr/share/lib/make /usr/ccs/bin/make /usr/xpg4/bin/make の三つが見つかりました。 このうち、Linuxでいう/usr/bin/makeにあたる物はどれなんでしょうか。 それとも、私は基本的に何か勘違いをしているでしょうか。 solarisもLinuxもよくわかっていません。 何かアドバイスいただけると嬉しいです。宜しくお願いいたします。

  • partition情報をMBRに書き込んで復旧

    http://okwave.jp/qa/q8404421.html に書いてある操作で USB の MBR を消去しようとしていたのに $ dd if=/dev/zero of=/dev/sda bs=512 count=1 として、間違えてHDDのMBRを消去してしまいました! 今のところ、LinuxMintは サスペンドとそこからの復旧はできています。gdiskの結果は次のとおりです。 dizzy@PC03 ~ $ sudo gdisk -l /dev/sda [sudo] password for shin: GPT fdisk (gdisk) version 0.8.1 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 1250263728 sectors, 596.2 GiB Logical sector size: 512 bytes Disk identifier (GUID): (略) Partition table holds up to 128 entries First usable sector is 34, last usable sector is 1250263694 Partitions will be aligned on 2048-sector boundaries Total free space is 1250263661 sectors (596.2 GiB) Number Start (sector) End (sector) Size Code Name 再起動をしてしまったら、MBRが消失しているのですから grub rescue のメッセージさえ出ないと思われますので、サスペンドしか今のところできません。 Gpartedでディスクの修復をしようとすると、 「ディスク全体をスキャンする必要があります。 このスキャンには非常に長い時間がかかるかもしれません。」 と出ますので、できれば他の方法を使いたいし、知っておきたいです。 dizzy@PC03 ~ $ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda10 20G 11G 7.8G 58% / udev 1.9G 4.0K 1.9G 1% /dev tmpfs 773M 1.1M 772M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.9G 312K 1.9G 1% /run/shm /dev/sda6 90G 12G 79G 13% /media/DATAFAT32_ /dev/sda9 20G 6.2G 13G 33% /media/Debian /dev/sda8 9.9G 6.8G 2.6G 73% /media/Ubuntu /dev/sda2 15G 7.3G 7.5G 50% /media/Recovery ファイルマネージャからも Recovery(Windows),Debian,Ubuntu,FAT32のデータ保存用パーティション が見えていて、中身のファイルを読み込むこともできています。 これらのパーティションのHDDの中での位置を Gparted,gdiskなどに分からせることができれば 残りの領域にどういうパーティションがあるかだけ検査させれば良いでしょうから、 HDD全体を最初からスキャンさせるより効率的になると思うのですが、 どうすればよいでしょうか? どうぞよろしくお願いいたします。 あと、grub-install の結果は次のとおりです。 dizzy@PC03 ~ $ sudo grub-install --recheck /dev/sda /usr/sbin/grub-probe: エラー: cannot find a GRUB drive for /dev/sda10. Check your device.map. Auto-detection of a filesystem of /dev/sda10 failed. Try with --recheck. If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <bug-grub@gnu.org> dizzy@PC03 ~ $ sudo /usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub /usr/sbin/grub-probe: 情報: `/boot/grub/device.map' を開けません. /usr/sbin/grub-probe: 情報: Scanning for dmraid_nv RAID devices on disk hd0. /usr/sbin/grub-probe: 情報: the size of hd0 is 1250263728. /usr/sbin/grub-probe: 情報: the size of hd0 is 1250263728. /usr/sbin/grub-probe: 情報: Scanning for dmraid_nv RAID devices on disk hd1. /usr/sbin/grub-probe: 情報: the size of hd1 is 3915776. /usr/sbin/grub-probe: 情報: the size of hd1 is 3915776. /usr/sbin/grub-probe: 情報: scanning hd0 for LVM. /usr/sbin/grub-probe: 情報: the size of hd0 is 1250263728. /usr/sbin/grub-probe: 情報: no LVM signature found. /usr/sbin/grub-probe: 情報: the size of hd0 is 1250263728. /usr/sbin/grub-probe: 情報: scanning hd1 for LVM. /usr/sbin/grub-probe: 情報: the size of hd1 is 3915776. /usr/sbin/grub-probe: 情報: no LVM signature found. /usr/sbin/grub-probe: 情報: the size of hd1 is 3915776. /usr/sbin/grub-probe: 情報: Scanning for mdraid09 RAID devices on disk hd0. (字数制限のため中略) /usr/sbin/grub-probe: 情報: scanning hd0 for LVM. /usr/sbin/grub-probe: 情報: the size of hd0 is 1250263728. /usr/sbin/grub-probe: 情報: no LVM signature found. /usr/sbin/grub-probe: 情報: the size of hd0 is 1250263728. /usr/sbin/grub-probe: 情報: scanning hd1 for LVM. /usr/sbin/grub-probe: 情報: the size of hd1 is 3915776. /usr/sbin/grub-probe: 情報: no LVM signature found. /usr/sbin/grub-probe: 情報: the size of hd1 is 3915776. /usr/sbin/grub-probe: 情報: /dev/sda10 starts from 283576320. /usr/sbin/grub-probe: 情報: opening the device hd0. /usr/sbin/grub-probe: 情報: the size of hd0 is 1250263728. /usr/sbin/grub-probe: エラー: cannot find a GRUB drive for /dev/sda10. Check your device.map.

  • PHPをバージョンアップしたらCRONが動かない

    CentOSとPHPをバージョンアップしたら、CRONだけが動かなくなってしまいました。 PATH関係が変わったことが問題のような検討がつくのですが、いろいろ試してもうまくいきません。どのように解決したら良いか教えていただければと思います。 [バージョンアップ内容] CentOSを5.3から5.7にバージョンアップ PHPを5.1.6から5.3.3にバージョンアップ phpMyAdmin3.4.8をインストール MySQL 5.0.77(バージョンアップせず) バージョンアップ前には ・PHPからMySQLにデータを登録するプログラムは動作していた。(ウェブサイト形式で動作確認) ・上記のプログラムはCRONで動いていた。(CRONでも動作確認) PHP5.1.6の時はCRONに下記のように登録していました。 10 * * * * /usr/bin/php /var/cron_file/test_cron.php アップデート後にウェブサイト形式でプログラムが動くことを確認しました(ページを開くと下記のプログラムが動作し、データをMySQLに登録) phpMyAdminも問題なく動きます。 CRONの問題点を探し出すために下記のことを行いました。 CRONのステータスを確認 # /etc/rc.d/init.d/crond status crond (pid 32151) を実行中... CRONをリスタート # /etc/init.d/crond restart crond を停止中: [ OK ] crond を起動中: CRONのエラーの確認 # vi /var/log/cron PHPの場所の確認 # find / -name php /usr/share/php /usr/include/php /usr/bin/php /usr/lib64/php /var/lib/php どれがPHPの場所なのかがわからないので、とりあえず5.1.6の時に指定していた「/usr/bin/php」を採用 このあたりはネットで情報を探して、登録してみたので正しいのかどうかよくわかりません。↓ PATHの記入 (その1) # vi /root/.bash_profile PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin export PATH (その2) #vi /etc/profile PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin export PATH PATHの確認 # env | grep PATH PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/php (上記以外にもいろいろいじっていたら、このようになってしまいました。上記以外のところでどこで設定したかがわからないので、PATHを消す方法も教えていただければと思います) 「/usr/kerberos/sbin:/usr/kerberos/bin」はもともとシステムで登録されていたもので、上記で登録した「/sbin:/usr/sbin:/bin:/usr/bin」以外のもの「/usr/bin/php」などはどこで登録したかわからなくなってしまったものです。 CRONでPATHを指定する部分でPHPのバージョンによりPATHの値が異なるという情報を見つける /usr/bin/php /usr/bin/php5 /usr/bin/php53 各パターンで 「10 * * * * /usr/bin/●● /var/cron_file/test_cron.php」 をcrontab -eに登録してエラーを見てみる。 (1)「*/1 * * * * /usr/bin/php /var/cron_file/test_cron.php」 # vi /var/log/cron →エラーに何も表示されない (2)「*/1 * * * * /usr/bin/php5 /var/cron_file/test_cron.php」 → エラーに何も表示されない。 (3)「*/1 * * * * /usr/bin/php53 /var/cron_file/test_cron.php」 →エラーが表示される Dec 16 20:20:01 ドメイン crond[11412]: (root) CMD (/usr/bin/php5 /var/cron_file/test_cron.php) クローン自体は動いていて、エラーがでているような感じは把握できたのですがここで行き詰まりました。 PHPのパス関係か、MySQLのパス関係、PHPとMySQLの連係、そのあたりのどこかが原因なのでしょうか? 参考資料としてphpinfo()の情報を記載します。 Loaded Configuration File  /etc/php.ini PATH /sbin:/usr/sbin:/bin:/usr/bin 参考)プログラムの内容 --------------------------------------------- require_once ('/var/DB接続情報保存ディレクトリ/password.php') try { $dbh = new PDO($DSN , $DBUSER , $DBPASS); $query=<<<EOF INSERT INTO test (name) VALUES (:name) EOF; $stmt = $dbh->prepare($query);    $name='斉藤太郎'; $stmt->bindParam(':name', $name); $stmt->execute(); }//try_end catch(PDOException $e) { print "Error!: " . $e->getMessage() . "<br>"; die(); }//catch_end ---------------------------------------------

    • ベストアンサー
    • PHP
  • Linuxのディスク。空いているはずなのに0

    /下は本来5GBくらいは空いているはずではないかと思うのですが、dfでみると空きが0になってしまいます。 # df ファイルシステム 1K-ブロック 使用 空き 使用% マウント位置 /dev/sda2 7637400 7637292 0 100% / /dev/sda1 101086 20574 75293 22% /boot none 1037388 0 1037388 0% /dev/shm /dev/sdb 20642428 9190668 10403184 47% /home /dev/sdc 15481840 6056152 8639256 42% /backup 192.168.1.100:/home/httpd 20642432 9172096 10421760 47% /mnt/192.168.1.100 //storage1/backup$ 2926654528 1877643692 1049010836 65% /mnt/storage1 //storage2/backup 1945310816 1782780424 162530392 92% /mnt/storage2 とすると /の空きが0になっています。 # find / -type d -maxdepth 1 | awk '{res = system("du -shx "$1) というコマンドで/以下のフォルダごとの容量を表示させると、下記のようになります。 find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments. 1.4G / 920M /usr 72K /dev 4.0K /net 4.0K /opt 15M /sbin 160M /var 12K /tmp 4.0K /.dev.static 8.0K /lib64 4.0K /srv 8.8G /home 255M /lib 5.0M /bin du: `/proc/5261/task': そのようなファイルやディレクトリはありません du: `/proc/5261/fd': そのようなファイルやディレクトリはありません 897M /proc 4.0K /media 20K /mnt 16K /lost+found 4.2M /root 0 /sys 4.0K /initrd 30M /etc 4.0K /misc 4.0K /selinux 15M /boot 5.8G /backup /の下は、duの結果にあるような、トータル7637292の容量を消費しているよう状態に見えません。何が問題なのでしょうか。確認すべき点を教えてください。

  • signal=SEGV で httpd起動できない

    ホストOS Windows7(HomeEdition sp1) に VirtualBox (Ver 4.1.8) で ゲスト Fedora16 をインストールしました。 物理的に1台のPC ( 64ビットオペレーション、実装メモリ 4.00GB) 内でホストオンリーアダプターで相互に接続する閉じた環境です。sshd, vsftpd はいずれも作動し、Windows側からFedoraを順調に操作できます。ところが、httpd を起動させようとすると、次のメッセージが出て起動できません。 諸サイト検索し、重大な障害であることらしいことは分かりましたが、対処法が分かりません。 どのようにすれば解決できますでしょうか? 何分にもよろしくお願いします。 ~]# systemctl start httpd.service Job failed. See system logs and 'systemctl status' for details. ~]# systemctl status httpd.service httpd.service - The Apache HTTP Server (prefork MPM) Loaded: loaded (/lib/systemd/system/httpd.service; disabled) Active: failed since Wed, 04 Apr 2012 20:23:16 +0900; 8min ago Process: 2090 ExecStart=/usr/sbin/httpd $OPTIONS -k start (code=dumped, signal=SEGV) CGroup: name=systemd:/system/httpd.service ~]#

  • jquery上で2つのスクリプトの合体

    下記のように「サブページその1  hoge.ne.jp/read1000.php」からスクレイピングしたtakahashiという文字を、「メインページ hogehoge.jp/index.html」の<input type="text">内に表示可能なスクリプトがあります。【現在できていること その1】 また、メインページで取得した変数123456を、URLという形で「サブページ2 read2222.php」のPHPに渡し、サブページ2の中で「123456についてのPHP処理した結果」を、再度メインページで取得して表示するスクリプトがあります。【現在できていること その2】 【やりたいこと】 この2つのスクリプトを合体させ「サブページ1 read1000.php」からスクレイピングしたtakahashiという文字を、URLという形で「サブページ2 read2222.php」のPHPに渡し、サブページ2の中で「takahashiについてのPHP処理した結果」を、再度メインページで取得して表示したいというのが今回の趣旨で、スタックしている部分となります。 ***************************************************************** 【現在できていること その1】 【サブページその1 http://hoge.ne.jp/read1000.php】 <table border="1"> <tbody> <tr> <td class="class3_sql_name">takahashi</td> </tr> </tbody> </table> 【メインページ http://hogehoge.jp/index.html】 <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <script src="js/jquery.xdomainajax.js"></script> <script> // 引っ張ってきたいサイトのURL url = 'http://hoge.ne.jp/read1000.php'; $.get(url, function(data){ var content3_sql_name = $(data.responseText).find('.class3_sql_name').text();   $("[name='ca2_stock_name']").val(content3_sql_name); }); </script> <input type="text" name="ca2_stock_name" value="" /> ***************************************************************** 上記のスクリプトを実行すると、 <input type="text" name="ca2_stock_name" value="takahashi" /> という形が完成します。 ****************************************************************** 【現在できていること その2】 【サブページその2 http://hoge.ne.jp/read2222.php】 <div id="news200"> こんにちは <?php echo $_GET["name"]; ?> さん </div> 【メインページ http://hogehoge.jp/index.html】 <script type="text/javascript"> var usr_id='123456' $(function(){ $("#read200").load("https://hoge.ne.jp/read2222.php?name="+usr_id+" #news200 ul", function(data) { if(data == null){ $("#read200").append("読込みに失敗しました"); } }); }); </script> <div id="read200"></div> ***************************************************************** 上記のスクリプトを実行すると、 メインページ 上で、サブページ2の<div id="news200"/>....<div> 間を拾ってきて表示することができます。                → こんにちは123456さん メインページ内で「read2222.php?name="+usr_id+"」という形でURLとして一旦サブページ2にトスし、 $_GET["name"] でサブページで処理しものをあらためてメインページで表示させています。 ***************************************************************** 【やりたいこと】 上記の2つのスクリプトを合体させ、 var usr_id='123456' の代わりに、 【http://hoge.ne.jp/read1000.php】にある<td class="class3_sql_name">takahashi</td> のtakahashiを表示させたいと考えています。                → こんにちはtakahashiさん 考え方としては var content3_sql_name の変数をvar usr_idの代わりにすればいいだけです。 ************************************************************** 【試したがうまくいかなかったスクリプト】 <script type="text/javascript"> url = 'http://hoge.ne.jp/read1000.php'; $.get(url, function(data){ var content3_sql_name = $(data.responseText).find('.class3_sql_name').text(); $(function(){ $("#read200").load("https://hoge.ne.jp/read5555.php?name="+content3_sql_name+" #news200 ul", function(data1) { if(data1 == null){ $("#read200").append("読込みに失敗しました"); } }); }); }); </script> <div id="read200"></div> ********************************************************** どこがいけないのかご指導いただけませんでしょうか? 宜しくお願い致します。

  • fedoraのcrontabについて

    linux初心者です。 今、fedora16で「新Linux/UNIX入門」という本を使って、Linuxを勉強しています。 crontabについて一つわからないことがあります。 本では/etc/crontabに 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly の記述があると書かれてありますが、自分のパソコンで$ cat /etc/crontabを実行してみると SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed となり、記述されているはずのものがありません。 ここではなく、/var/spool/cron/rootの方に記述されているかと思って、その中も見てみたのですが、記述されていそうにありません。 どこにこれは記述されているのでしょうか? いろいろといじくっているうちに、誤って自分で消してしまったのでしょうか? どなたかご回答よろしくお願い致します。

  • nginxでCGIが動きません

    お世話になります。 以下に質問をさせていただきます。 <概要> CentOS7にnginxをインストールし、Movable Type(以下、mt)を導入しようとしているのですが、 mtのインストールモジュール(*.cgi)をキックしても、HTTP 403エラーと表示されてしまいます。 同ディレクトリのindex.htmlは問題なく表示されます。 関連するディレクトリおよびファイルのアクセス権は一律755に設定。 CGIが動く環境にし、mtインストールを可能としたいと思っております、 どうかよろしくお願い致します。 <導入状況>  ・nginx   →ドキュメントルート: /var/www/html     mtモジュール格納場所: /var/www/cgi-bin/mt-site   →defaut.confは以下のように記述    location ~ \.cgi$ {    index index.html;   fastcgi_pass unix:/var/run/fcgiwrap.socket;   include /etc/nginx/fastcgi_params;   fastcgi_param SCRIPT_FILENAME /var/www/cgi-bin/mt-site$fastcgi_script_name;   }  ・CGI動かすためにspawn-fcgi、fcgiwrap、fcgi-develをインストール   spawn-fcgiの記述は以下のとおり    FCGI_SOCKET=/var/run/fcgiwrap.socket    FCGI_PROGRAM=/usr/local/sbin/fcgiwrap    FCGI_USER=nginx    FCGI_GROUP=nginx    FCGI_EXTRA_OPTIONS="-M 0770"    OPTIONS="-u $FCGI_USER -g $FCGI_GROUP -s $FCGI_SOCKET -S $FCGI_EXTRA_OPTIONS -F 1 -P /var/run/spawn-fcgi.pid -- $FCGI_PROGRAM" 初めての投稿のため、配慮が足りず情報が足りない等ありましたら 申し訳ありませんが、ご連絡いただけますと可能な限り答えますので なにとぞよろしくお願い致します。 よろしくお願い致します。

  • ドメインに参加しているのにWinbind起動エラー

    複数の質問投稿で大変恐縮です。 CentOS7にSambaを入れ、ファイルサーバーとして運用したいと考えています。 同じくSambaで構築したドメインに「net ads join -U administrator」のコマンドで参加できました。 その後で、winbind をstartさせようとしましたが、下記エラーで起動できません。 (centos70がファイルサーバーのコンピューター名、test.comがドメイン名です。) winbind.service - Samba Winbind Daemon Loaded: loaded (/usr/lib/systemd/system/winbind.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since 水 2019-07-17 22:16:22 JST; 7min ago Docs: man:winbindd(8) man:samba(7) man:smb.conf(5) Process: 30514 ExecStart=/usr/sbin/winbindd --foreground --no-process-group $WINBINDOPTIONS (code=exited, status=1/FAILURE) Main PID: 30514 (code=exited, status=1/FAILURE) 7月 17 22:16:22 centos70.test.com winbindd[30514]: [2019/07/17 22:16:22.756390, 0] ../source3/winbindd/winbindd_cache.c:31...cache) 7月 17 22:16:22 centos70.test.com winbindd[30514]: initialize_winbindd_cache: clearing cache and re-creating with version number 2 7月 17 22:16:22 centos70.test.com winbindd[30514]: [2019/07/17 22:16:22.758942, 0] ../source3/winbindd/winbindd_util.c:126..._list) 7月 17 22:16:22 centos70.test.com winbindd[30514]: Could not fetch our SID - did we join? 7月 17 22:16:22 centos70.test.com winbindd[30514]: [2019/07/17 22:16:22.758970, 0] ../source3/winbindd/winbindd.c:1360(win...dlers) 7月 17 22:16:22 centos70.test.com winbindd[30514]: unable to initialize domain list 7月 17 22:16:22 centos70.test.com systemd[1]: winbind.service: main process exited, code=exited, status=1/FAILURE 7月 17 22:16:22 centos70.test.com systemd[1]: Failed to start Samba Winbind Daemon. 7月 17 22:16:22 centos70.test.com systemd[1]: Unit winbind.service entered failed state. 7月 17 22:16:22 centos70.test.com systemd[1]: winbind.service failed. Hint: Some lines were ellipsized, use -l to show in full. このためか、smbも下記エラーで起動できません。 ● smb.service - Samba SMB Daemon Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since 水 2019-07-17 22:23:44 JST; 13min ago Docs: man:smbd(8) man:samba(7) man:smb.conf(5) Process: 31073 ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=255) Main PID: 31073 (code=exited, status=255) 7月 17 22:23:43 centos70.test.com systemd[1]: Starting Samba SMB Daemon... 7月 17 22:23:44 centos70.test.com smbd[31073]: [2019/07/17 22:23:44.050879, 0] ../source3/auth/auth_util.c:1372(make_new_s...guest) 7月 17 22:23:44 centos70.test.com smbd[31073]: create_local_token failed: NT_STATUS_NO_MEMORY 7月 17 22:23:44 centos70.test.com smbd[31073]: [2019/07/17 22:23:44.050927, 0] ../source3/smbd/server.c:1993(main) 7月 17 22:23:44 centos70.test.com smbd[31073]: ERROR: failed to setup guest info. 7月 17 22:23:44 centos70.test.com systemd[1]: smb.service: main process exited, code=exited, status=255/n/a 7月 17 22:23:44 centos70.test.com systemd[1]: Failed to start Samba SMB Daemon. 7月 17 22:23:44 centos70.test.com systemd[1]: Unit smb.service entered failed state. 7月 17 22:23:44 centos70.test.com systemd[1]: smb.service failed. Hint: Some lines were ellipsized, use -l to show in full. nmbサービスは起動します。 smb.confの内容は下記の通りです。 [global] dos charset = CP932 unix charset = UTF-8 wins support = yes workgroup = TEST # password server = 192.168.12.9 realm = TEST.COM security = ads # idmap config * : range = 16777216-33554431 idmap config TEST:backend = rid idmap config TEST:range = 20000-29999 template shell = /bin/bash kerberos method = secrets only winbind use default domain = true winbind offline logon = false log level = 1 [shared] path = /mnt/strage writeable = yes comment = test.com ShareFolder vfs objects = acl_xattr acl_xattr:ignore system acls = yes Winbindとsmbを起動するにはどうすればよろしいでしょうか。 何卒ご教示いただけますと幸いです。よろしくお願い申し上げます。