From f1d1281c0438003c65056c1235d28b34f786fb82 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 20 Dec 2007 15:44:38 +0000 Subject: Let service_started_daemon work off SVCNAME --- src/Makefile | 4 ++-- src/rc.c | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src') 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); -- cgit v1.2.3