I'm writing a simple daemon application using C/C++ and I want it to start when Linux starts up.
I have tried to modify /etc/init.d/skeleton
to add a script into the init.d directory as follows
added my daemon application in
/usr/sbin/
directory and changedNAME=myDaemon
write
update-rc.d myDaemon default
in Terminaland it added symbolic links to
rc#.d
directories
But it didn't work.
My second try was to modify rc.local
as
/usr/sbin/myDaemon start
But this didn't work either.
How can I make my daemon start with the OS? I want to do everything programmatically.
I use Ubuntu 10.10 but if there exists a general solution for all distributions, that would be great!
/etc/init.d/mamoudservice
script. Try to run/bin/bash -vx /etc/init.d/mamondservice start
and you'll understand what is happening. On a more general note, learn more about your operating system before adding services to it. We cannot help more because we have no idea of how your/usr/sbin/mamouddaemon
operate, and which program options it is accepting. – Jan 22 '12 at 09:49/etc/init.d/skeleton
is no more. – JdeBP Nov 10 '18 at 04:53