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

Diff of /trunk/src/rc.c

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

Revision 2999 Revision 3000
1024 /* Load our deptree now */ 1024 /* Load our deptree now */
1025 if ((deptree = _rc_deptree_load ()) == NULL) 1025 if ((deptree = _rc_deptree_load ()) == NULL)
1026 eerrorx ("failed to load deptree"); 1026 eerrorx ("failed to load deptree");
1027 1027
1028 /* Clean the failed services state dir now */ 1028 /* Clean the failed services state dir now */
1029 if ((dp = opendir (RC_SVCDIR "/failed"))) {
1030 while ((d = readdir (dp))) {
1031 if (d->d_name[0] == '.' &&
1032 (d->d_name[1] == '\0' ||
1033 (d->d_name[1] == '.' && d->d_name[2] == '\0')))
1034 continue;
1035
1036 asprintf (&tmp, RC_SVCDIR "/failed/%s", d->d_name);
1037 if (tmp) {
1038 if (unlink (tmp))
1039 eerror ("%s: unlink `%s': %s", applet, tmp,
1040 strerror (errno));
1041 free (tmp);
1042 }
1043 }
1044 closedir (dp);
1029 rc_rm_dir (RC_SVCDIR "/failed", false); 1045 rmdir (RC_SVCDIR "/failed");
1046 }
1030 1047
1031 mkdir (RC_STOPPING, 0755); 1048 mkdir (RC_STOPPING, 0755);
1032 1049
1033#ifdef __linux__ 1050#ifdef __linux__
1034 /* udev likes to start services before we're ready when it does 1051 /* udev likes to start services before we're ready when it does
1035 its coldplugging thing. runscript knows when we're not ready so it 1052 its coldplugging thing. runscript knows when we're not ready so it
1036 stores a list of coldplugged services in DEVBOOT for us to pick up 1053 stores a list of coldplugged services in DEVBOOT for us to pick up
1037 here when we are ready for them */ 1054 here when we are ready for them */
1038 if ((dp = opendir (DEVBOOT))) { 1055 if ((dp = opendir (DEVBOOT))) {
1039 while ((d = readdir (dp))) { 1056 while ((d = readdir (dp))) {
1057 if (d->d_name[0] == '.' &&
1058 (d->d_name[1] == '\0' ||
1059 (d->d_name[1] == '.' && d->d_name[2] == '\0')))
1060 continue;
1061
1040 if (rc_service_exists (d->d_name) && 1062 if (rc_service_exists (d->d_name) &&
1041 rc_service_plugable (d->d_name)) 1063 rc_service_plugable (d->d_name))
1042 rc_service_mark (d->d_name, RC_SERVICE_COLDPLUGGED); 1064 rc_service_mark (d->d_name, RC_SERVICE_COLDPLUGGED);
1065
1066 tmp = asprintf (&tmp, RC_SVCDIR "/failed/%s", d->d_name);
1067 if (tmp) {
1068 if (unlink (tmp))
1069 eerror ("%s: unlink `%s': %s", applet, tmp,
1070 strerror (errno));
1071 free (tmp);
1072 }
1043 } 1073 }
1044 closedir (dp); 1074 closedir (dp);
1045 rc_rm_dir (DEVBOOT, true); 1075 rmdir (DEVBOOT);
1046 } 1076 }
1047#else 1077#else
1048 /* BSD's on the other hand populate /dev automagically and use devd. 1078 /* BSD's on the other hand populate /dev automagically and use devd.
1049 The only downside of this approach and ours is that we have to hard code 1079 The only downside of this approach and ours is that we have to hard code
1050 the device node to the init script to simulate the coldplug into 1080 the device node to the init script to simulate the coldplug into

Legend:
Removed from v.2999  
changed lines
  Added in v.3000

  ViewVC Help
Powered by ViewVC 1.1.20