/[baselayout]/trunk/src/runscript.c
Gentoo

Diff of /trunk/src/runscript.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2750 Revision 2762
988 bool deps = true; 988 bool deps = true;
989 bool doneone = false; 989 bool doneone = false;
990 char pid[16]; 990 char pid[16];
991 int retval; 991 int retval;
992 int opt; 992 int opt;
993 char *svc;
993 994
994 /* We need the full path to the service */ 995 /* We need the full path to the service */
995 if (*argv[1] == '/') 996 if (*argv[1] == '/')
996 service = rc_xstrdup (argv[1]); 997 service = rc_xstrdup (argv[1]);
997 else { 998 else {
1079 1080
1080 /* eprefix is kinda klunky, but it works for our purposes */ 1081 /* eprefix is kinda klunky, but it works for our purposes */
1081 if (rc_is_env ("RC_PREFIX", "yes")) { 1082 if (rc_is_env ("RC_PREFIX", "yes")) {
1082 int l = 0; 1083 int l = 0;
1083 int ll; 1084 int ll;
1084 char *svc;
1085 1085
1086 /* Get the longest service name */ 1086 /* Get the longest service name */
1087 services = rc_services_in_runlevel (NULL); 1087 services = rc_services_in_runlevel (NULL);
1088 STRLIST_FOREACH (services, svc, i) { 1088 STRLIST_FOREACH (services, svc, i) {
1089 ll = strlen (svc); 1089 ll = strlen (svc);
1219 uncoldplug (); 1219 uncoldplug ();
1220 1220
1221 if (in_background && 1221 if (in_background &&
1222 rc_service_state (service, rc_service_inactive)) 1222 rc_service_state (service, rc_service_inactive))
1223 { 1223 {
1224 char *svc;
1225 int j; 1224 int j;
1226 STRLIST_FOREACH (restart_services, svc, j) 1225 STRLIST_FOREACH (restart_services, svc, j)
1227 if (rc_service_state (svc, rc_service_stopped)) 1226 if (rc_service_state (svc, rc_service_stopped))
1228 rc_schedule_start_service (service, svc); 1227 rc_schedule_start_service (service, svc);
1229 } 1228 }
1233 uncoldplug (); 1232 uncoldplug ();
1234 } else if (strcmp (optarg, "help") == 0) { 1233 } else if (strcmp (optarg, "help") == 0) {
1235 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL); 1234 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
1236 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s", 1235 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
1237 applet, strerror (errno)); 1236 applet, strerror (errno));
1237 } else if (strcmp (optarg, "ineed") == 0 ||
1238 strcmp (optarg, "iuse") == 0 ||
1239 strcmp (optarg, "needsme") == 0 ||
1240 strcmp (optarg, "usesme") == 0 ||
1241 strcmp (optarg, "iafter") == 0 ||
1242 strcmp (optarg, "ibefore") == 0
1243 strcmp (optorg, "iprovide") == 0) {
1244 if (! deptree && ((deptree = rc_load_deptree ()) == NULL))
1245 eerrorx ("failed to load deptree");
1246
1247 rc_strlist_free (types);
1248 types = rc_strlist_add (NULL, optarg);
1249 rc_strlist_free (svclist);
1250 svclist = rc_strlist_add (NULL, applet);
1251 rc_strlist_free (services);
1252 services = rc_get_depends (deptree, types, svclist, softlevel, 0);
1253 STRLIST_FOREACH (services, svc, i)
1254 printf ("%s%s", i == 1 ? "" : " ", svc);
1255 printf ("\n");
1238 }else 1256 }else
1239 svc_exec (optarg, NULL); 1257 svc_exec (optarg, NULL);
1240 1258
1241 /* Flush our buffered output if any */ 1259 /* Flush our buffered output if any */
1242 eflush (); 1260 eflush ();

Legend:
Removed from v.2750  
changed lines
  Added in v.2762

  ViewVC Help
Powered by ViewVC 1.1.20