Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 278931 Details for
Bug 348724
sys-apps/openrc does not respect custom restart function
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for hb-working-rcscripts (handbook chapter on init scripts)
hb-working-rcscripts.patch (text/plain), 2.33 KB, created by
Sven Vermeulen
on 2011-07-03 14:19:02 UTC
(
hide
)
Description:
Patch for hb-working-rcscripts (handbook chapter on init scripts)
Filename:
MIME Type:
Creator:
Sven Vermeulen
Created:
2011-07-03 14:19:02 UTC
Size:
2.33 KB
patch
obsolete
>Index: hb-working-rcscripts.xml >=================================================================== >RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-rcscripts.xml,v >retrieving revision 1.32 >diff -u -t -r1.32 hb-working-rcscripts.xml >--- hb-working-rcscripts.xml 2 Mar 2011 08:09:48 -0000 1.32 >+++ hb-working-rcscripts.xml 3 Jul 2011 14:16:32 -0000 >@@ -440,10 +440,6 @@ > stop() { > <comment>(Commands necessary to stop the service)</comment> > } >- >-restart() { >- <comment>(Commands necessary to restart the service)</comment> >-} > </pre> > > <p> >@@ -574,6 +570,11 @@ > > <pre caption="Example start() function"> > start() { >+ if [ "${RC_CMD}" = "restart" ]; >+ then >+ <comment># Do something in case a restart requires more than stop, start</comment> >+ fi >+ > ebegin "Starting my_service" > start-stop-daemon --start --exec /path/to/my_service \ > --pidfile /path/to/my_pidfile >@@ -591,6 +592,15 @@ > service fails to start. > </p> > >+<p> >+Another notable setting used in the above example is to check the contents of >+the <c>RC_CMD</c> variable. Unlike the previous init script system, the newer >+<c>openrc</c> system does not support script-specific restart functionality. >+Instead, the script needs to check the contents of the <c>RC_CMD</c> variable to >+see if a function (be it <c>start()</c> or <c>stop()</c>) is called as part of a >+restart or not. >+</p> >+ > <note> > Make sure that <c>--exec</c> actually calls a service and not just a shell > script that launches services and exits -- that's what the init script is >@@ -604,14 +614,13 @@ > </p> > > <p> >-Other functions you can define are: <c>stop()</c> and <c>restart()</c>. You are >-not obliged to define these functions! Our init system is intelligent enough to >-fill these functions by itself if you use <c>start-stop-daemon</c>. >+Another function you can define is <c>stop()</c>. You are not obliged to define >+this function though! Our init system is intelligent enough to fill this >+functions by itself if you use <c>start-stop-daemon</c>. > </p> > > <p> >-Although you do not <e>have</e> to create a <c>stop()</c> function, here is an >-example: >+Here is an example of a <c>stop()</c> function: > </p> > > <pre caption="Example stop() function"> >@@ -681,6 +690,10 @@ > } > </pre> > >+<impo> >+The function <c>restart()</c> however cannot be overridden in openrc! >+</impo> >+ > </body> > </subsection> > <subsection>
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 348724
:
257150
|
257152
| 278931