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

Diff of /trunk/src/rc.c

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

Revision 2656 Revision 2659
31#include "rc.h" 31#include "rc.h"
32#include "rc-misc.h" 32#include "rc-misc.h"
33#include "rc-plugin.h" 33#include "rc-plugin.h"
34#include "strlist.h" 34#include "strlist.h"
35 35
36#define INITSH RC_LIBDIR "sh/init.sh" 36#define INITSH RC_LIBDIR "sh/init.sh"
37#define HALTSH RC_INITDIR "halt.sh" 37#define INITEARLYSH RC_LIBDIR "sh/init-early.sh"
38#define HALTSH RC_INITDIR "halt.sh"
38 39
39#define RC_SVCDIR_STARTING RC_SVCDIR "starting/" 40#define RC_SVCDIR_STARTING RC_SVCDIR "starting/"
40#define RC_SVCDIR_INACTIVE RC_SVCDIR "inactive/" 41#define RC_SVCDIR_INACTIVE RC_SVCDIR "inactive/"
41#define RC_SVCDIR_STARTED RC_SVCDIR "started/" 42#define RC_SVCDIR_STARTED RC_SVCDIR "started/"
42#define RC_SVCDIR_COLDPLUGGED RC_SVCDIR "coldplugged/" 43#define RC_SVCDIR_COLDPLUGGED RC_SVCDIR "coldplugged/"
43 44
44#define INTERACTIVE RC_SVCDIR "interactive" 45#define INTERACTIVE RC_SVCDIR "interactive"
45 46
46#define DEVBOOT "/dev/.rcboot" 47#define DEVBOOT "/dev/.rcboot"
47 48
48/* Cleanup anything in main */ 49/* Cleanup anything in main */
49#define CHAR_FREE(_item) if (_item) { \ 50#define CHAR_FREE(_item) if (_item) { \
697 int status = 0; 698 int status = 0;
698#ifdef __linux__ 699#ifdef __linux__
699 FILE *fp; 700 FILE *fp;
700#endif 701#endif
701 702
703 /* exec init-early.sh if it exists
704 * This should just setup the console to use the correct
705 * font. Maybe it should setup the keyboard too? */
706 if (rc_exists (INITEARLYSH)) {
707 if ((pid = vfork ()) == -1)
708 eerrorx ("%s: vfork: %s", applet, strerror (errno));
709
710 if (pid == 0) {
711 execl (INITEARLYSH, INITEARLYSH, (char *) NULL);
712 eerror ("%s: unable to exec `" INITEARLYSH "': %s",
713 applet, strerror (errno));
714 _exit (EXIT_FAILURE);
715 }
716
717 do {
718 wpid = waitpid (pid, &status, 0);
719 if (wpid < 1)
720 eerror ("waitpid: %s", strerror (errno));
721 } while (! WIFEXITED (status) && ! WIFSIGNALED (status));
722 }
723
702 uname (&uts); 724 uname (&uts);
703 725
704 printf ("\n"); 726 printf ("\n");
705 printf (" %sGentoo/%s; %shttp://www.gentoo.org/%s" 727 printf (" %sGentoo/%s; %shttp://www.gentoo.org/%s"
706 "\n Copyright 1999-2007 Gentoo Foundation; " 728 "\n Copyright 1999-2007 Gentoo Foundation; "
1069 /* We always stop the service when in these runlevels */ 1091 /* We always stop the service when in these runlevels */
1070 if (going_down) { 1092 if (going_down) {
1071 pid_t pid = rc_stop_service (service); 1093 pid_t pid = rc_stop_service (service);
1072 if (pid > 0 && ! rc_is_env ("RC_PARALLEL", "yes")) 1094 if (pid > 0 && ! rc_is_env ("RC_PARALLEL", "yes"))
1073 rc_waitpid (pid); 1095 rc_waitpid (pid);
1096 continue;
1074 } 1097 }
1075 1098
1076 /* If we're in the start list then don't bother stopping us */ 1099 /* If we're in the start list then don't bother stopping us */
1077 STRLIST_FOREACH (start_services, svc1, j) 1100 STRLIST_FOREACH (start_services, svc1, j)
1078 if (strcmp (svc1, service) == 0) { 1101 if (strcmp (svc1, service) == 0) {

Legend:
Removed from v.2656  
changed lines
  Added in v.2659

  ViewVC Help
Powered by ViewVC 1.1.20