openrc/sh
Robin H. Johnson f27d60add9
sh/openrc-run.sh: expose default start/stop/status
Supervisor setups break easily when start/stop/status functions are not
default.

Applications that write multiple PIDs to a pidfile (eg HAProxy as
described in bug 601540), can also benefit from being able to call the
default start/stop/status with modified environment variables.

Expose the default start/stop/status functions as
default_start/stop/status, and use them for the defaults
start/stop/status.

Trivial usage example:
```
  stop()
  {
    t=$(mktemp)
    for pid in $(cat $pidfile) ; do
      echo $pid >$t
      pidfile=$t default_stop
    done
    rm -f $t
  }
```

X-Gentoo-Bug: 601540
X-Gentoo-Bug-URL: https://bugs.gentoo.org/601540
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2016-12-17 14:50:11 -08:00
..
.gitignore split tmpfiles processing into opentmpfiles 2016-12-01 12:04:54 -06:00
binfmt.sh.in binfmt.sh: use read in raw mode 2016-02-19 15:25:53 -06:00
cgroup-release-agent.sh.in Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
functions.sh.in Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
gendepends.sh.in Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
init-early.sh.Linux.in Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
init.sh.BSD.in sh/init.sh: fix the test for cache restoration 2016-09-12 12:58:31 -05:00
init.sh.GNU-kFreeBSD.in sh/init.sh: fix the test for cache restoration 2016-09-12 12:58:31 -05:00
init.sh.GNU.in sh/init.sh: fix the test for cache restoration 2016-09-12 12:58:31 -05:00
init.sh.Linux.in Fix typos 2016-12-17 18:41:02 +00:00
Makefile split tmpfiles processing into opentmpfiles 2016-12-01 12:04:54 -06:00
migrate-to-run.sh.in Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
openrc-run.sh.in sh/openrc-run.sh: expose default start/stop/status 2016-12-17 14:50:11 -08:00
rc-cgroup.sh.in Fix permission checks for cgroups 2016-09-14 12:34:42 -05:00
rc-functions.sh.in add support for -containers keyword 2015-12-03 16:52:15 -06:00
rc-mount.sh Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
runit.sh Make use of name vs RC_SVCNAME consistent in supervisor scripts 2016-09-13 12:52:10 -05:00
runtests.sh Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
s6.sh Make use of name vs RC_SVCNAME consistent in supervisor scripts 2016-09-13 12:52:10 -05:00
start-stop-daemon.sh Revert "Remove eval calls from supervisor start functions" 2016-09-20 11:33:56 -05:00
supervise-daemon.sh Revert "Remove eval calls from supervisor start functions" 2016-09-20 11:33:56 -05:00