私はbeagleBoardを持っていて、起動時に(起動/再起動)スクリプトを起動したいと思います。だから、次のコマンドを実行しました。 update-rc.d GatewayStart.sh defaults
出力には以下が表示されます。ヘッダーが拒否されました。
root@beaglebone:/etc/init.d# update-rc.d GatewayStart.sh defaults
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'S18led_aging' missing LSB tags and overrides
insserv: warning: script 'led_aging.sh' missing LSB tags and overrides
insserv: There is a loop between service rmnologin and mountnfs if started
insserv: loop involving service mountnfs at depth 9
insserv: loop involving service networking at depth 8
insserv: There is a loop between service led_aging and mountall if started
insserv: loop involving service mountall at depth 7
insserv: loop involving service checkfs at depth 6
insserv: loop involving service kbd at depth 8
insserv: There is a loop between service led_aging and mountall-bootclean if started
insserv: loop involving service mountall-bootclean at depth 8
insserv: There is a loop at service rmnologin if started
insserv: There is a loop between service rmnologin and mountnfs-bootclean if started
insserv: loop involving service mountnfs-bootclean at depth 8
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Max recursions depth 99 reached
insserv: loop involving service saned at depth 1
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system
facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: loop involving service urandom at depth 10
insserv: There is a loop at service led_aging if started
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: Starting led_aging.sh depends on rmnologin and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
他のスクリプトのヘッダーをコピーし、提供されたタグの名前を変更しました。。私のスクリプトは次のとおりです
#!/bin/bash
### BEGIN INIT INFO
# Provides: GatewayStart.sh
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
HOME="/home/debian"
{
export PATH="$PATH:$HOME/Gateway/usr/lib/jvm/jdk-7-oracle-armhf/bin"
#tar -zxvf jdk-7-oracle-armhf.tar.gz
echo $PATH
export JAVA_HOME="$HOME/Gateway/usr/lib/jvm/jdk-7-oracle-armhf"
case $1 in
stop)
echo "in stop"
$HOME/Gateway/apache-karaf-3.0.2/bin/stop
echo " stop done"
;; # case start end
*)
echo "start or default runs"
$JAVA_HOME/db/bin/stopNetworkServer&
sleep 15
echo "stopped derby"
$JAVA_HOME/db/bin/startNetworkServer&
db_count=0
while [ $db_count -ne 1 ]
do
echo "derby is not started yet"
sleep 10
db_count="$($HOME/Gateway/usr/lib/jvm/jdk-7-oracle-armhf/db/bin/ij $HOME/Gateway/scripts.sql | grep -c selected)"
echo $db_count
done
echo " DB started "
echo "**********************************************************************************"
echo " Bringing UP GATEWAY "
echo "**********************************************************************************"
echo $HOME
$HOME/Gateway/IPUUartInterface/build/UDP_UART "127.0.0.1" 30005 "127.0.0.1" 30004 /dev/ttyUSB0 4 x&
echo "command for UPD_UART ran"
$HOME/Gateway/apache-karaf-3.0.2/bin/stop
echo "if any previous instance is running , it is stopped"
$HOME/Gateway/apache-karaf-3.0.2/bin/start
sleep 20
a=1
b=1
while [ $b -lt 8 ] && [ $a -lt 9 ]
do
echo $a
sleep 80
a="$($HOME/Gateway/apache-karaf-3.0.2/bin/client -a 8101 -h 127.0.0.1 -u karaf bundle:list | grep -c Active)"
echo "now"
echo $a
b=$((b+1))
done
echo "while loop is over"
if [ $a -ne 9 ]
then
echo "karaf needs manual interruption"
exit 0
fi
echo "***********************************************************************************"
echo " Karaf is Running... "
echo "*********************************************************************************"
esac
exit 0
} >> $HOME/Reboot_log.txt
答え1
Googleで検索してみると、このようなエラーが出ますね。 2つのオプションがあります。
a) フラッシュボードの最新イメージを使用します。 b) led_aging.sh スクリプトを googlegroups とブログで提供されるスクリプトに置き換えます。
それで、2番目のオプションを最初に試してみましたが、効果がありました。 led_aging.shの目的が何であるかわかりません。
実際のled_aging.shは次のとおりです。
> #!/bin/sh
> # tary, 16:46 2013-4-22
>
> x=$(/bin/ps -ef | /bin/grep "[l]ed_acc") if [ ! -n "$x" -a -x
> /usr/bin/led_acc ]; then /usr/bin/led_acc & fi
新しいled_aging.shは次のとおりです。
> #!/bin/sh -e
> ### BEGIN INIT INFO
> # Provides: led_aging.sh
> # Required-Start: $local_fs
> # Required-Stop: $local_fs
> # Default-Start: 2 3 4 5
> # Default-Stop: 0 1 6
> # Short-Description: Start LED aging
> # Description: Starts LED aging (whatever that is)
> ### END INIT INFO
> x=$(/bin/ps -ef | /bin/grep "[l]ed_acc") if [ ! -n "$x" -a -x
> /usr/bin/led_acc ]; then /usr/bin/led_acc & fi
答え2
この試み
今後:::::::::::::::::::::
#!/bin/bash
### BEGIN INIT INFO
# Provides: GatewayStart.sh
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
::::::::::::::::::::::::::::::
後ろに##########################
#!/bin/bash
#
GatewayStart init script
### BEGIN INIT INFO
# Provides: GatewayStart.sh
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
ここのすべての行は#としてコメントされています。
一部の行の先頭からこの#が削除される理由がわかりません。
#答え3
問題はまったく異なるファイルにあります。これは、次のような多くのエラーメッセージに名前が付けられていますled_aging.sh
。
正しいLSBヘッダーがありません。 WWWの一部の人々は、次の機能を備えたバージョンを提供しています。