summaryrefslogtreecommitdiff
path: root/init.d/local.in
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-01-06 12:13:33 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-01-20 12:50:29 -0600
commit10ce67886d214850feaf60d6945fe2568da6ef84 (patch)
treeb12c56d9ac682cf13e42f5d9ba668473929cbe04 /init.d/local.in
parenteebb2d1b9cf0da22ed654ca7ac97a0ae845802ba (diff)
downloadopenrc-10ce67886d214850feaf60d6945fe2568da6ef84.tar.gz
openrc-10ce67886d214850feaf60d6945fe2568da6ef84.tar.bz2
openrc-10ce67886d214850feaf60d6945fe2568da6ef84.tar.xz
change local to run programs
This changes the local service so that it will run programs located in @sysconfdir@/local.d instead of the local_start and local_stop functions from @sysconfdir@/conf.d/local. The advantage for the user is that these programs are not part of the openrc package, so the user does not have to worry about them being overwritten when openrc is upgraded. X-Gentoo-Bug: 351465 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=351465
Diffstat (limited to 'init.d/local.in')
-rw-r--r--init.d/local.in28
1 files changed, 23 insertions, 5 deletions
diff --git a/init.d/local.in b/init.d/local.in
index 63d5e92..5583fea 100644
--- a/init.d/local.in
+++ b/init.d/local.in
@@ -2,7 +2,7 @@
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
-description="Executes user commands in /etc/conf.d/local"
+description="Executes user programs in @SYSCONFDIR@/local.d"
depend()
{
@@ -12,22 +12,40 @@ depend()
start()
{
- ebegin "Starting local"
+ 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 $? "Failed to start local"
+ return 0
}
stop()
{
- ebegin "Stopping local"
+ 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 $? "Failed to stop local"
+ return 0
}