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

Diff of /trunk/src/runscript.c

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

Revision 2581 Revision 2582
27#include "rc.h" 27#include "rc.h"
28#include "rc-misc.h" 28#include "rc-misc.h"
29#include "rc-plugin.h" 29#include "rc-plugin.h"
30#include "strlist.h" 30#include "strlist.h"
31 31
32#define RCSCRIPT_HELP RC_LIBDIR "/sh/rc-help.sh" 32#define RCSCRIPT_HELP RC_LIBDIR "/sh/rc-help.sh"
33#define SELINUX_LIB RC_LIBDIR "/runscript_selinux.so" 33#define SELINUX_LIB RC_LIBDIR "/runscript_selinux.so"
34 34
35static char *applet = NULL; 35static char *applet = NULL;
36static char *exclusive = NULL; 36static char *exclusive = NULL;
37static char *mtime_test = NULL; 37static char *mtime_test = NULL;
38static rc_depinfo_t *deptree = NULL; 38static rc_depinfo_t *deptree = NULL;
425 if (rc_is_env ("RC_STRICT_DEPEND", "yes")) 425 if (rc_is_env ("RC_STRICT_DEPEND", "yes"))
426 depoptions |= RC_DEP_STRICT; 426 depoptions |= RC_DEP_STRICT;
427 427
428 if (rc_is_env ("IN_HOTPLUG", "1") || in_background) { 428 if (rc_is_env ("IN_HOTPLUG", "1") || in_background) {
429 if (! rc_service_state (service, rc_service_inactive) && 429 if (! rc_service_state (service, rc_service_inactive) &&
430 ! rc_service_state (service, rc_service_stopped)) 430 ! rc_service_state (service, rc_service_stopped))
431 exit (EXIT_FAILURE); 431 exit (EXIT_FAILURE);
432 background = true; 432 background = true;
433 } 433 }
434 434
435 if (rc_service_state (service, rc_service_started)) 435 if (rc_service_state (service, rc_service_started))
632 rc_service_state (service, rc_service_failed)) 632 rc_service_state (service, rc_service_failed))
633 exit (EXIT_FAILURE); 633 exit (EXIT_FAILURE);
634 634
635 if (rc_is_env ("IN_HOTPLUG", "1") || in_background) 635 if (rc_is_env ("IN_HOTPLUG", "1") || in_background)
636 if (! rc_service_state (service, rc_service_started) && 636 if (! rc_service_state (service, rc_service_started) &&
637 ! rc_service_state (service, rc_service_inactive)) 637 ! rc_service_state (service, rc_service_inactive))
638 exit (EXIT_FAILURE); 638 exit (EXIT_FAILURE);
639 639
640 if (rc_service_state (service, rc_service_stopped)) 640 if (rc_service_state (service, rc_service_stopped))
641 ewarnx ("WARNING: %s is already stopped", applet); 641 ewarnx ("WARNING: %s is already stopped", applet);
642 else if (rc_service_state (service, rc_service_stopping)) 642 else if (rc_service_state (service, rc_service_stopping))
817 char pid[16]; 817 char pid[16];
818 int retval; 818 int retval;
819 char c; 819 char c;
820 820
821 static struct option longopts[] = { 821 static struct option longopts[] = {
822 { "debug", 0, NULL, 'd'}, 822 { "debug", 0, NULL, 'd'},
823 { "help", 0, NULL, 'h'}, 823 { "help", 0, NULL, 'h'},
824 { "nocolor", 0, NULL, 'C'}, 824 { "nocolor", 0, NULL, 'C'},
825 { "nocolour", 0, NULL, 'C'}, 825 { "nocolour", 0, NULL, 'C'},
826 { "nodeps", 0, NULL, 'D'}, 826 { "nodeps", 0, NULL, 'D'},
827 { "quiet", 0, NULL, 'q'}, 827 { "quiet", 0, NULL, 'q'},
828 { "verbose", 0, NULL, 'v'}, 828 { "verbose", 0, NULL, 'v'},
829 { NULL, 0, NULL, 0} 829 { NULL, 0, NULL, 0}
830 }; 830 };
831 831
832 /* Show help if insufficient args */ 832 /* Show help if insufficient args */
833 if (argc < 3) { 833 if (argc < 3) {
834 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, (char *) NULL); 834 execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, (char *) NULL);

Legend:
Removed from v.2581  
changed lines
  Added in v.2582

  ViewVC Help
Powered by ViewVC 1.1.20