RC_SERVICE now points to the service file, so daemons can recall us directly.
This commit is contained in:
parent
568ec5f343
commit
40e12f6ba0
@ -2,4 +2,4 @@
|
|||||||
# Wrapper for ifwatchd(8)
|
# Wrapper for ifwatchd(8)
|
||||||
|
|
||||||
export IN_BACKGROUND=yes
|
export IN_BACKGROUND=yes
|
||||||
@PREFIX@@SYSCONFDIR@/init.d/net.$1 --quiet start
|
${RC_SERVICE} --quiet start
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
# Wrapper for ifwatchd(8)
|
# Wrapper for ifwatchd(8)
|
||||||
|
|
||||||
export IN_BACKGROUND=yes
|
export IN_BACKGROUND=yes
|
||||||
@PREFIX@@SYSCONFDIR@/init.d/net.$1 --quiet stop
|
${RC_SERVICE} --quiet stop
|
||||||
|
@ -18,6 +18,9 @@ if [ -z "$1" -o -z "$2" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# So daemons know where to recall us if needed
|
||||||
|
export RC_SERVICE="$1"
|
||||||
|
|
||||||
# Descript the init script to the user
|
# Descript the init script to the user
|
||||||
describe()
|
describe()
|
||||||
{
|
{
|
||||||
|
@ -560,7 +560,6 @@ static void run_script (const char *script)
|
|||||||
eerrorx ("%s: failed to exec `%s'", applet, script);
|
eerrorx ("%s: failed to exec `%s'", applet, script);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PREFIX
|
|
||||||
static void do_coldplug (void)
|
static void do_coldplug (void)
|
||||||
{
|
{
|
||||||
size_t s;
|
size_t s;
|
||||||
@ -661,7 +660,6 @@ static void do_coldplug (void)
|
|||||||
printf (" %s", service);
|
printf (" %s", service);
|
||||||
printf ("%s\n", ecolor (ECOLOR_NORMAL));
|
printf ("%s\n", ecolor (ECOLOR_NORMAL));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "_usage.h"
|
#include "_usage.h"
|
||||||
#define getoptstring "o:" getoptstring_COMMON
|
#define getoptstring "o:" getoptstring_COMMON
|
||||||
@ -869,9 +867,9 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PREFIX
|
/* Setup our coldplugged services now */
|
||||||
do_coldplug ();
|
do_coldplug ();
|
||||||
#endif
|
|
||||||
rc_plugin_run (RC_HOOK_RUNLEVEL_START_OUT, newlevel);
|
rc_plugin_run (RC_HOOK_RUNLEVEL_START_OUT, newlevel);
|
||||||
hook_out = 0;
|
hook_out = 0;
|
||||||
|
|
||||||
|
@ -966,7 +966,8 @@ int start_stop_daemon (int argc, char **argv)
|
|||||||
|
|
||||||
/* Clean the environment of any RC_ variables */
|
/* Clean the environment of any RC_ variables */
|
||||||
STRLIST_FOREACH (environ, env, i) {
|
STRLIST_FOREACH (environ, env, i) {
|
||||||
if (strncmp (env, "RC_", 3) == 0 ||
|
if ((strncmp (env, "RC_", 3) == 0 &&
|
||||||
|
strncmp (env, "RC_SERVICE=", strlen ("RC_SERVICE=")) != 0) ||
|
||||||
strncmp (env, "SSD_NICELEVEL=", strlen ("SSD_NICELEVEL=")) == 0)
|
strncmp (env, "SSD_NICELEVEL=", strlen ("SSD_NICELEVEL=")) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user