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

Diff of /trunk/src/runscript.c

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

Revision 2555 Revision 2560
229 { 229 {
230 if (rc_service_state (applet, rc_service_starting)) 230 if (rc_service_state (applet, rc_service_starting))
231 { 231 {
232 if (rc_service_state (applet, rc_service_wasinactive)) 232 if (rc_service_state (applet, rc_service_wasinactive))
233 rc_mark_service (applet, rc_service_inactive); 233 rc_mark_service (applet, rc_service_inactive);
234 else
235 rc_mark_service (applet, rc_service_stopped);
236 }
237 else if (rc_service_state (applet, rc_service_stopping))
238 {
239 /* If the we're shutting down, do it cleanly */
240 if ((softlevel &&
241 rc_runlevel_stopping () &&
242 (strcmp (softlevel, RC_LEVEL_SHUTDOWN) == 0 ||
243 strcmp (softlevel, RC_LEVEL_REBOOT) == 0)))
244 rc_mark_service (applet, rc_service_stopped);
245 else if (rc_service_state (applet, rc_service_wasinactive))
246 rc_mark_service (applet, rc_service_inactive);
234 else 247 else
235 rc_mark_service (applet, rc_service_stopped); 248 rc_mark_service (applet, rc_service_started);
236 }
237 else if (rc_service_state (applet, rc_service_stopping))
238 {
239 /* If the we're shutting down, do it cleanly */
240 if ((softlevel && rc_runlevel_stopping () &&
241 (strcmp (softlevel, RC_LEVEL_SHUTDOWN) == 0 ||
242 strcmp (softlevel, RC_LEVEL_REBOOT) == 0)) ||
243 ! rc_service_state (applet, rc_service_wasinactive))
244 rc_mark_service (applet, rc_service_stopped);
245 else
246 rc_mark_service (applet, rc_service_inactive);
247 } 249 }
248 if (exclusive && rc_exists (exclusive)) 250 if (exclusive && rc_exists (exclusive))
249 unlink (exclusive); 251 unlink (exclusive);
250 } 252 }
251 253
1047 } 1049 }
1048 else if (strcmp (argv[i], "stop") == 0) 1050 else if (strcmp (argv[i], "stop") == 0)
1049 { 1051 {
1050 if (in_background) 1052 if (in_background)
1051 get_started_services (); 1053 get_started_services ();
1054
1055 svc_stop (service, deps);
1056
1057 if (! in_background &&
1052 else if (! rc_runlevel_stopping ()) 1058 ! rc_runlevel_stopping () &&
1059 rc_service_state (service, rc_service_stopped))
1053 uncoldplug (applet); 1060 uncoldplug (applet);
1054
1055 svc_stop (service, deps);
1056 1061
1057 if (in_background && 1062 if (in_background &&
1058 rc_service_state (service, rc_service_inactive)) 1063 rc_service_state (service, rc_service_inactive))
1059 { 1064 {
1060 char *svc; 1065 char *svc;
1067 else if (strcmp (argv[i], "zap") == 0) 1072 else if (strcmp (argv[i], "zap") == 0)
1068 { 1073 {
1069 einfo ("Manually resetting %s to stopped state", applet); 1074 einfo ("Manually resetting %s to stopped state", applet);
1070 rc_mark_service (applet, rc_service_stopped); 1075 rc_mark_service (applet, rc_service_stopped);
1071 uncoldplug (applet); 1076 uncoldplug (applet);
1072 } 1077 }
1073 else if (strcmp (argv[i], "help") == 0) 1078 else if (strcmp (argv[i], "help") == 0)
1074 { 1079 {
1075 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL); 1080 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
1076 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s", 1081 eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
1077 applet, strerror (errno)); 1082 applet, strerror (errno));

Legend:
Removed from v.2555  
changed lines
  Added in v.2560

  ViewVC Help
Powered by ViewVC 1.1.20