Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 260281 Details for
Bug 351465
sys-apps/openrc: change the local service so that it runs programs instead of functions
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-change-local-to-run-programs.patch
0001-change-local-to-run-programs.patch (text/plain), 4.57 KB, created by
William Hubbs
on 2011-01-19 18:39:03 UTC
(
hide
)
Description:
0001-change-local-to-run-programs.patch
Filename:
MIME Type:
Creator:
William Hubbs
Created:
2011-01-19 18:39:03 UTC
Size:
4.57 KB
patch
obsolete
>From 540fdba467aa019f7db302f59b7ed14d65272abf Mon Sep 17 00:00:00 2001 >From: William Hubbs <williamh@gentoo.org> >Date: Thu, 6 Jan 2011 12:13:33 -0600 >Subject: [PATCH] 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 >--- > Makefile | 2 +- > conf.d/Makefile | 2 +- > conf.d/local | 18 ------------------ > init.d/local.in | 26 +++++++++++++++++++++----- > local.d/Makefile | 6 ++++++ > local.d/README | 9 +++++++++ > mk/sys.mk | 1 + > 7 files changed, 39 insertions(+), 25 deletions(-) > delete mode 100644 conf.d/local > create mode 100644 local.d/Makefile > create mode 100644 local.d/README > >diff --git a/Makefile b/Makefile >index 8f9cc95..18a8ddf 100644 >--- a/Makefile >+++ b/Makefile >@@ -4,7 +4,7 @@ > > include Makefile.inc > >-SUBDIR= conf.d etc init.d man scripts sh src >+SUBDIR= conf.d etc init.d local.d man scripts sh src > > # Build our old net foo or not > _OLDNET_SH= case "${MKOLDNET}" in \ >diff --git a/conf.d/Makefile b/conf.d/Makefile >index 034dc74..374bfdb 100644 >--- a/conf.d/Makefile >+++ b/conf.d/Makefile >@@ -1,5 +1,5 @@ > DIR= ${CONFDIR} >-CONF= bootmisc fsck hostname local localmount network staticroute urandom >+CONF= bootmisc fsck hostname localmount network staticroute urandom > > TARGETS+= network staticroute > CLEANFILES+= network staticroute >diff --git a/conf.d/local b/conf.d/local >deleted file mode 100644 >index 97dbbcc..0000000 >--- a/conf.d/local >+++ /dev/null >@@ -1,18 +0,0 @@ >-# Here is where you can put anything you need to start >-# that there is not an init script for. >- >-local_start() { >- # This is a good place to load any misc programs >- # on startup (use &>/dev/null to hide output) >- >- # We should always return 0 >- return 0 >-} >- >-local_stop() { >- # This is a good place to unload any misc. >- # programs you started above. >- >- # We should always return 0 >- return 0 >-} >diff --git a/init.d/local.in b/init.d/local.in >index 63d5e92..a46b9ed 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,38 @@ 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 ending in start 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 ending in stop in @SYSCONFDIR@/local.d" > local_stop > fi > >- eend $? "Failed to stop local" >+ return 0 > } >diff --git a/local.d/Makefile b/local.d/Makefile >new file mode 100644 >index 0000000..7a7d31d >--- /dev/null >+++ b/local.d/Makefile >@@ -0,0 +1,6 @@ >+DIR= ${LOCALDIR} >+CONF= README >+ >+MK= ../mk >+include ${MK}/os.mk >+include ${MK}/scripts.mk >diff --git a/local.d/README b/local.d/README >new file mode 100644 >index 0000000..f12045f >--- /dev/null >+++ b/local.d/README >@@ -0,0 +1,9 @@ >+This directory should contain programs or scripts which are to be run >+when the local service is started or stopped. >+ >+If a file in this directory is executable and the name ends with start, >+it will be run when the local service is started. If a file is >+executable and the name ends with stop, it will be run when the local >+service is stopped. >+ >+All files are processed in lexical order. >diff --git a/mk/sys.mk b/mk/sys.mk >index e22731b..e9bbf60 100644 >--- a/mk/sys.mk >+++ b/mk/sys.mk >@@ -21,6 +21,7 @@ PICFLAG?= -fPIC > SYSCONFDIR?= ${PREFIX}/etc > INITDIR?= ${SYSCONFDIR}/init.d > CONFDIR?= ${SYSCONFDIR}/conf.d >+LOCALDIR?= ${SYSCONFDIR}/local.d > > BINDIR?= ${PREFIX}/sbin > BINMODE?= 0755 >-- >1.7.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 351465
:
260204
|
260216
|
260224
| 260281