summaryrefslogtreecommitdiff
path: root/sample.initd
diff options
context:
space:
mode:
Diffstat (limited to 'sample.initd')
-rw-r--r--sample.initd27
1 files changed, 7 insertions, 20 deletions
diff --git a/sample.initd b/sample.initd
index a034601..0dc706c 100644
--- a/sample.initd
+++ b/sample.initd
@@ -1,29 +1,16 @@
-#!/sbin/runscript
+#!/sbin/openrc-run
# Sample init.d file for alpine linux.
name=
-daemon=/usr/sbin/$name
+command="/usr/sbin/$name"
+command_args="$sample_opts"
+command_background="yes"
+
+start_stop_daemon_args="--user $sample_user:$sample_group"
+pidfile="/run/$name.pid"
depend() {
need net
after firewall
}
-
-start() {
- ebegin "Starting ${name}"
- start-stop-daemon --start --quiet \
- --pidfile /var/run/${name}.pid \
- --chuid ${sample_user}:${sample_group} \
- --exec ${daemon} -- ${sample_opts}
- eend $?
-}
-
-stop() {
- ebegin "Stopping ${name}"
- start-stop-daemon --stop --quiet \
- --pidfile /var/run/$name.pid \
- --exec ${daemon}
- eend $?
-}
-