openrc/init.d/local.in
Andrew Gregory 8a44067838 Fix shebangs in services to point to the correct location of runscript
SBINDIR and BINDIR can be set independently of PREFIX.  This fixes
broken shebangs in service files when SBINDIR is set to something other
than PREFIX/sbin

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2013-02-23 20:30:39 -06:00

52 lines
1015 B
Plaintext

#!@SBINDIR@/runscript
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.
description="Executes user programs in @SYSCONFDIR@/local.d"
depend()
{
after *
keyword -timeout
}
start()
{
einfo "Starting local"
local file
for file in @SYSCONFDIR@/local.d/*.start ; do
[ -x "$file" ] && "$file"
done
if type local_start >/dev/null 2>&1; then
ewarn "@SYSCONFDIR@/conf.d/local should be removed."
ewarn "Please move the code from the local_start function"
ewarn "to scripts with an .start extension"
ewarn "in @SYSCONFDIR@/local.d"
local_start
fi
eend 0
}
stop()
{
einfo "Stopping local"
local file
for file in @SYSCONFDIR@/local.d/*.stop; do
[ -x "$file" ] && "$file"
done
if type local_start >/dev/null 2>&1; then
ewarn "@SYSCONFDIR@/conf.d/local should be removed."
ewarn "Please move the code from the local_stop function"
ewarn "to scripts with an .stop extension"
ewarn "in @SYSCONFDIR@/local.d"
local_stop
fi
eend 0
}