I wrote a daemon which watches for files in certain directory and if a new file is copied to this directory, then it is committed to SVN. New files appear in this directory only if remote devices copy files there over scp. Now I would like to create a System-V init script for this daemon in OpenSUSE 11.4. It's clear that Required-Start: line should contain only the $sshd boot facility as this ensures that local file-system is mounted, networking is operational and sshd is started. Those three boot facilities are prerequisites for the daemon, i.e. there is no point to start the daemon if sshd is not operational and thus it is impossible that it receives new files over scp. However, I'm bit puzzled how should I configure the Required-Stop: line, which lists any boot facilities which should NOT be stopped before shutting down the daemon. It looks logical to me to have local file systems mounted and networking operational(for uploading the files to SVN) while sshd is stopped(for not receiving any new files) before the daemon is stopped. Required-Stop: $sshd could create a situation where daemon is stopped while a new file is received over scp before the sshd is stopped.

So in a nutshell, following approach seems to be most logical to me:

# Required-Start: $sshd
# Required-Stop: $local_fs $network

Am I correct?


According to https://wiki.debian.org/LSBInitScripts in the section on Required-Stop

Normally you would include here the same facilities as for the Required-Start keyword.

Having this script running before ssh starts isn't a problem like you suggested in the OP it just means this daemon will be waiting for files that will never appear until ssh starts. This script, however, definitely does need the functionality of $local_fs and $network so I would use the following two lines

# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.