diff options
-rw-r--r-- | sample.confd | 4 | ||||
-rw-r--r-- | sample.initd | 30 |
2 files changed, 12 insertions, 22 deletions
diff --git a/sample.confd b/sample.confd index eb0eecf..486252b 100644 --- a/sample.confd +++ b/sample.confd @@ -1,7 +1,7 @@ # Sample conf.d file for alpine linux # -# Specify daemon $OPTS here. +# Specify daemon options here. # -OPTS="" +sample_opts="" diff --git a/sample.initd b/sample.initd index 42d03e0..a034601 100644 --- a/sample.initd +++ b/sample.initd @@ -2,38 +2,28 @@ # Sample init.d file for alpine linux. -NAME= -DAEMON=/usr/sbin/$NAME +name= +daemon=/usr/sbin/$name depend() { need net + after firewall } start() { - ebegin "Starting ${NAME}" + ebegin "Starting ${name}" start-stop-daemon --start --quiet \ - --pidfile /var/run/${NAME}.pid \ - --chuid ${DAEMON_USER}:${DAEMON_GROUP} \ - --exec ${DAEMON} -- ${OPTS} + --pidfile /var/run/${name}.pid \ + --chuid ${sample_user}:${sample_group} \ + --exec ${daemon} -- ${sample_opts} eend $? } stop() { - ebegin "Stopping ${NAME}" + ebegin "Stopping ${name}" start-stop-daemon --stop --quiet \ - --exec ${DAEMON} \ - --pidfile /var/run/${NAME}.pid \ - eend $? -} - -reload() { - ebegin "Reloading ${NAME}" - if ! service_started "${NAME}" ; then - eend 1 "${NAME} is not started" - return 1 - fi - start-stop-daemon --stop --oknodo --signal HUP \ - --exec ${DAEMON} --pidfile /var/run/${NAME}.pid + --pidfile /var/run/$name.pid \ + --exec ${daemon} eend $? } |