I've a debian minimal installation, and I just want to start a custom script at startup.
- I've a script at /etc/init.d/myscript,
-
I put a
chmod 700
, and create symlinks toS20myscript
into :/etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d
But then, script is NOT launched at all on startup.
When I use this script with update-rc.d
(or insserv
…), it works.
I don't understand, am I forced to use this command?
(and no, I don't want to use /etc/rc.local
).
Best Answer
Try removing all symlinks in the
rc*.d
directories.Then, try running:
Where
-n
meansnot-really
This will list what insserv is supposed to do : making the symlink and generating some
.depend.*
filesHave a look at the
init.d/.depend.boot
,init.d/.depend.start
andinit.d/.depend.stop
: maybe you need to update those files as well ? If you decide to change them by hand (but what's wrong withupdate-rc.d
?) be extra careful that further calls toupdate-rc.d
are not going to mess with your edits...See
man startpar
andman insserv
in order to gain some knowledge about the usage of how these.depend.*
files.And my final advice is: use
update-rc.d
:)