I have been trying to create a daemon using
/etc/init.d/myservice and it will call a shell script that contains
nohup within the script line.
Will it affect it if I could do
service stop later?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Nohup just blocks SIGHUP. The rc script to start or stop your daemon could use any signals at all to shut down your process.
This link has a good overview of the things a daemon process needs to do on startup, for example closing
stderr, detaching itself from the parent and getting a new process group and setting up signal handlers.
You can check this script I wrote recently, it should help: