aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-20 15:44:38 +0000
committerRoy Marples <roy@marples.name>2007-12-20 15:44:38 +0000
commitf1d1281c0438003c65056c1235d28b34f786fb82 (patch)
tree0a83c6c72f8c2100c0a85ed5cac56335a172033d /src
parent0560b64fcb5965551da212e667ab3964511e8f86 (diff)
Let service_started_daemon work off SVCNAME
Diffstat (limited to 'src')
-rw-r--r--src/Makefile4
-rw-r--r--src/rc.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index 654ea367..c9df27eb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -67,9 +67,9 @@ RC_BINLINKS = einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \
service_starting service_started \
service_stopping service_stopped \
service_inactive service_wasinactive \
- service_coldplugged \
+ service_coldplugged service_started_daemon \
checkpath fstabinfo mountinfo rc-depend \
- service_get_value service_set_value get_options save_options
+ service_get_value service_set_value get_options save_options
RC_SBINLINKS = mark_service_starting mark_service_started \
mark_service_stopping mark_service_stopped \
mark_service_inactive mark_service_wasinactive \
diff --git a/src/rc.c b/src/rc.c
index a733db0b..a472dadb 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -320,10 +320,17 @@ static int do_service (int argc, char **argv)
ok = (rc_service_state (service) & RC_SERVICE_WASINACTIVE);
else if (strcmp (applet, "service_started_daemon") == 0) {
int idx = 0;
- if (argc > 2)
+ char *d = argv[0];
+
+ service = getenv ("SVCNAME");
+ if (argc > 2) {
+ service = argv[0];
+ d = argv[1];
sscanf (argv[2], "%d", &idx);
- exit (rc_service_started_daemon (argv[0], argv[1], idx)
- ? 0 : 1);
+ } else if (argc == 2) {
+ sscanf (argv[1], "%d", &idx);
+ }
+ exit (rc_service_started_daemon (service, d, idx) ? 0 : 1);
} else
eerrorx ("%s: unknown applet", applet);