diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-05-24 01:42:02 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-06-13 12:34:05 +0000 |
commit | 799c8d532be398f676af41ec474e1ecca447090d (patch) | |
tree | 18e4ad5a22e30c94625ac64261d06e8b22b5b26b /sample.initd | |
parent | 8c92572bed4443372da4ea79d7f089eeeb6a96bb (diff) | |
download | abuild-799c8d532be398f676af41ec474e1ecca447090d.tar.gz abuild-799c8d532be398f676af41ec474e1ecca447090d.tar.bz2 abuild-799c8d532be398f676af41ec474e1ecca447090d.tar.xz abuild-799c8d532be398f676af41ec474e1ecca447090d.zip |
sample.initd: modernize
Diffstat (limited to 'sample.initd')
-rw-r--r-- | sample.initd | 27 |
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 $? -} - |