June 2017
Intermediate to advanced
478 pages
13h 14m
English
Imagine that you have a program named simpleserver , which is written as a traditional Unix daemon, in other words, it forks and runs in the background: the code for such a program is in MELP/chapter_10/simpleserver. You will need an init.d script like this, which you will find in MELP/chapter_10/simpleserver-sysvinit:
#! /bin/sh case "$1" in start) echo "Starting simpelserver" start-stop-daemon -S -n simpleserver -a /usr/bin/simpleserver ;; stop) echo "Stopping simpleserver" start-stop-daemon -K -n simpleserver ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0
start-stop-daemon is a helper function that makes it easier to manipulate background processes such as this. It originally came from the Debian ...
Read now
Unlock full access