I'm trying to write a script which starts a program with some parameters at startup (after boot) and therefore I'm using /etc/init.d.
This is my script:
#!/bin/bash
### BEGIN INIT INFO
# Provides: GetTempValues in /var/www/modules/programs
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts a program
# Description: Starts a program
### END INIT INFO
#Actions
case "$1" in
start)
# START
sudo chmod +x /var/www/modules/programs/GetTemperatureValues/startProgramm.sh
sudo /var/www/modules/programs/GetTemperatureValues/startProgramm.sh 11 4 /var/www/modules/programs/GetTemperatureValues//logfile_11_4.txt
;;
stop)
# STOP
echo "This does not do anything..."
;;
restart)
# RESTART
sudo chmod +x /var/www/modules/programs/GetTemperatureValues/startProgramm.sh
sudo /var/www/modules/programs/GetTemperatureValues/startProgramm.sh 11 4 /var/www/modules/programs/GetTemperatureValues//logfile_11_4.txt
;;
esac
exit 0
But whenever I execute this command, so the script will be executed at bootup, I get a bunch of errors:
sudo update-rc.d start_GetTempValues.sh defaults
I get these errors:
insserv: can not remove(../rc0.d/K01bluetooth): No such file or directory
insserv: can not remove(../rc0.d/K06hwclock.sh): No such file or directory
insserv: can not remove(../rc0.d/K06networking): No such file or directory
insserv: can not remove(../rc0.d/K07umountfs): No such file or directory
insserv: can not remove(../rc0.d/K05rpcbind): No such file or directory
insserv: can not remove(../rc0.d/K05nfs-common): No such file or directory
insserv: can not remove(../rc0.d/K04umountnfs.sh): No such file or directory
insserv: can not remove(../rc0.d/K03rsyslog): No such file or directory
insserv: can not remove(../rc0.d/K02sendsigs): No such file or directory
insserv: can not remove(../rc0.d/K08umountroot): No such file or directory
insserv: can not remove(../rc0.d/K09halt): No such file or directory
insserv: can not remove(../rc1.d/K01bluetooth): No such file or directory
insserv: can not remove(../rc1.d/K05rpcbind): No such file or directory
insserv: can not remove(../rc1.d/K05nfs-common): No such file or directory
insserv: can not remove(../rc1.d/K03rsyslog): No such file or directory
insserv: can not remove(../rc6.d/K01bluetooth): No such file or directory
insserv: can not remove(../rc6.d/K06hwclock.sh): No such file or directory
insserv: can not remove(../rc6.d/K06networking): No such file or directory
insserv: can not remove(../rc6.d/K07umountfs): No such file or directory
insserv: can not remove(../rc6.d/K09reboot): No such file or directory
insserv: can not remove(../rc6.d/K05rpcbind): No such file or directory
insserv: can not remove(../rc6.d/K05nfs-common): No such file or directory
insserv: can not remove(../rc6.d/K04umountnfs.sh): No such file or directory
insserv: can not remove(../rc6.d/K03rsyslog): No such file or directory
insserv: can not remove(../rc6.d/K02sendsigs): No such file or directory
insserv: can not remove(../rc6.d/K08umountroot): No such file or directory
insserv: can not remove(../rc0.d/K01bluetooth): No such file or directory
insserv: can not remove(../rc0.d/K06hwclock.sh): No such file or directory
insserv: can not remove(../rc0.d/K06networking): No such file or directory
insserv: can not remove(../rc0.d/K07umountfs): No such file or directory
insserv: can not remove(../rc0.d/K05rpcbind): No such file or directory
insserv: can not remove(../rc0.d/K05nfs-common): No such file or directory
insserv: can not remove(../rc0.d/K04umountnfs.sh): No such file or directory
insserv: can not remove(../rc0.d/K03rsyslog): No such file or directory
insserv: can not remove(../rc0.d/K02sendsigs): No such file or directory
insserv: can not remove(../rc0.d/K08umountroot): No such file or directory
insserv: can not remove(../rc0.d/K09halt): No such file or directory
insserv: can not remove(../rc0.d/K07umountfs): No such file or directory
insserv: can not symlink(../init.d/umountfs, ../rc0.d/K04umountfs): File exists
insserv: can not remove(../rc0.d/K04umountnfs.sh): No such file or directory
insserv: can not symlink(../init.d/umountnfs.sh, ../rc0.d/K03umountnfs.sh): File exists
insserv: can not remove(../rc0.d/K08umountroot): No such file or directory
insserv: can not symlink(../init.d/umountroot, ../rc0.d/K05umountroot): File exists
insserv: can not remove(../rc0.d/K09halt): No such file or directory
insserv: can not symlink(../init.d/halt, ../rc0.d/K06halt): File exists
insserv: can not remove(../rc1.d/K01bluetooth): No such file or directory
insserv: can not remove(../rc1.d/K05rpcbind): No such file or directory
insserv: can not remove(../rc1.d/K05nfs-common): No such file or directory
insserv: can not remove(../rc1.d/K03rsyslog): No such file or directory
insserv: can not remove(../rc6.d/K01bluetooth): No such file or directory
insserv: can not remove(../rc6.d/K06hwclock.sh): No such file or directory
insserv: can not remove(../rc6.d/K06networking): No such file or directory
insserv: can not remove(../rc6.d/K07umountfs): No such file or directory
insserv: can not remove(../rc6.d/K09reboot): No such file or directory
insserv: can not remove(../rc6.d/K05rpcbind): No such file or directory
insserv: can not remove(../rc6.d/K05nfs-common): No such file or directory
insserv: can not remove(../rc6.d/K04umountnfs.sh): No such file or directory
insserv: can not remove(../rc6.d/K03rsyslog): No such file or directory
insserv: can not remove(../rc6.d/K02sendsigs): No such file or directory
insserv: can not remove(../rc6.d/K08umountroot): No such file or directory
insserv: can not remove(../rc6.d/K07umountfs): No such file or directory
insserv: can not symlink(../init.d/umountfs, ../rc6.d/K04umountfs): File exists
insserv: can not remove(../rc6.d/K04umountnfs.sh): No such file or directory
insserv: can not symlink(../init.d/umountnfs.sh, ../rc6.d/K03umountnfs.sh): File exists
insserv: can not remove(../rc6.d/K08umountroot): No such file or directory
insserv: can not symlink(../init.d/umountroot, ../rc6.d/K05umountroot): File exists
insserv: can not remove(../rc6.d/K09reboot): No such file or directory
insserv: can not symlink(../init.d/reboot, ../rc6.d/K06reboot): File exists
Please don't give me security advices, I'd be really thankful for working solutions.
/etc/rc.local
, init.d is a bit deprecated, use systemd instead.