私のLinuxマシンにはhomebrew init.dスクリプトがあり、Debian 4とDebian 5では正常に動作しますが、Debian 6(新しいインストール)ではシステム起動時にのみ実行され、再起動の実装前には実行されません。
スクリプトは実際には次のようになります。
### BEGIN INIT INFO
# Provides: selfheal
# Required-Start:
# Required-Stop:
# X-Start-Before: mountall
# X-Stop-After: umountfs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: selfheal tool
# Description: Saves/restores the user partition at (re)boot
### END INIT INFO
echo $0 $*
sleep 3
# some useful stuff follows here...
reboot
システムがrunlevel 6
ファイルシステムを切り替えてマウント解除することを確認しました(上記を参照)X-Stop-After: umountfs
。私のスクリプトには命の痕跡が見えませんselfheal
。
システム内始めるしかし、行が見え、echo
スクリプトが実行中です。
次のコマンドを使用してスクリプトをインストールしました。
rm /etc/rc*.d/[SK]??selfheal && update-rc.d selfheal defaults
そこにエラー/警告はありません。シンボリックリンクが存在します。
root@intermodul:~# ls -al /etc/rc6.d/
total 12
drwxr-xr-x 2 root root 4096 May 16 16:09 .
drwxr-xr-x 68 root root 4096 May 16 16:07 ..
<snip>
lrwxrwxrwx 1 root root 18 May 16 15:09 K09umountfs -> ../init.d/umountfs
lrwxrwxrwx 1 root root 18 May 16 16:09 K10selfheal -> ../init.d/selfheal
lrwxrwxrwx 1 root root 20 May 16 15:09 K10umountroot -> ../init.d/umountroot
lrwxrwxrwx 1 root root 16 May 16 15:09 K11reboot -> ../init.d/reboot
-rw-r--r-- 1 root root 351 Jan 1 06:34 README
Debian 6 は同時起動を提供することに注意してください。 「INIT INFO」に問題があるようです。
ここに問題がありますか?
修正する
CONCURRENCY=none
スクリプトはセットアップ時に実行されますが、/etc/init.d/rc
makefileの並行性を有効にしたいと思います。それでは、makefile同時モードでスクリプトを実行できないのはなぜですか?
ベストアンサー1
私はその理由を見つけました:
BEGIN INIT INFO
スクリプトが完了するまでルートファイルシステムがアンマウントされないように、そのセクションに次の行が必要です。
Should-Stop: umountroot
これはumountroot
私のスクリプトに「依存関係」を引き起こします。