diff options
author | Roy Marples <roy@marples.name> | 2007-12-20 15:44:38 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-20 15:44:38 +0000 |
commit | f1d1281c0438003c65056c1235d28b34f786fb82 (patch) | |
tree | 0a83c6c72f8c2100c0a85ed5cac56335a172033d | |
parent | 0560b64fcb5965551da212e667ab3964511e8f86 (diff) |
Let service_started_daemon work off SVCNAME
-rw-r--r-- | src/Makefile | 4 | ||||
-rw-r--r-- | src/rc.c | 13 |
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 \ @@ -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); |