| … | |
… | |
| 45 | "stopping", |
45 | "stopping", |
| 46 | "inactive", |
46 | "inactive", |
| 47 | "wasinactive", |
47 | "wasinactive", |
| 48 | "coldplugged", |
48 | "coldplugged", |
| 49 | "failed", |
49 | "failed", |
|
|
50 | "scheduled", |
| 50 | NULL |
51 | NULL |
| 51 | }; |
52 | }; |
| 52 | |
53 | |
| 53 | bool rc_runlevel_starting (void) |
54 | bool rc_runlevel_starting (void) |
| 54 | { |
55 | { |
| … | |
… | |
| 259 | while (rc_service_state_names[i]) |
260 | while (rc_service_state_names[i]) |
| 260 | { |
261 | { |
| 261 | if ((i != skip_state && |
262 | if ((i != skip_state && |
| 262 | i != rc_service_stopped && |
263 | i != rc_service_stopped && |
| 263 | i != rc_service_coldplugged && |
264 | i != rc_service_coldplugged && |
|
|
265 | i != rc_service_scheduled && |
| 264 | i != rc_service_crashed) && |
266 | i != rc_service_crashed) && |
| 265 | (! skip_wasinactive || i != rc_service_wasinactive)) |
267 | (! skip_wasinactive || i != rc_service_wasinactive)) |
| 266 | { |
268 | { |
| 267 | file = rc_strcatpaths (RC_SVCDIR, rc_service_state_names[i], base, |
269 | file = rc_strcatpaths (RC_SVCDIR, rc_service_state_names[i], base, |
| 268 | (char *) NULL); |
270 | (char *) NULL); |
| … | |
… | |
| 545 | { |
547 | { |
| 546 | char *dir; |
548 | char *dir; |
| 547 | char *init; |
549 | char *init; |
| 548 | char *file; |
550 | char *file; |
| 549 | |
551 | |
| 550 | if (! rc_service_exists (service) || ! rc_service_exists (service_to_start)) |
552 | /* service may be a provided service, like net */ |
|
|
553 | if (! service || ! rc_service_exists (service_to_start)) |
| 551 | return; |
554 | return; |
| 552 | |
555 | |
| 553 | dir = rc_strcatpaths (RC_SVCDIR, "scheduled", basename (service), |
556 | dir = rc_strcatpaths (RC_SVCDIR, "scheduled", basename (service), |
| 554 | (char *) NULL); |
557 | (char *) NULL); |
| 555 | if (! rc_is_dir (dir)) |
558 | if (! rc_is_dir (dir)) |
| … | |
… | |
| 654 | { |
657 | { |
| 655 | char *dir = rc_strcatpaths (RC_SVCDIR, rc_service_state_names[state], |
658 | char *dir = rc_strcatpaths (RC_SVCDIR, rc_service_state_names[state], |
| 656 | (char *) NULL); |
659 | (char *) NULL); |
| 657 | char **list = NULL; |
660 | char **list = NULL; |
| 658 | |
661 | |
|
|
662 | if (state == rc_service_scheduled) |
|
|
663 | { |
|
|
664 | char **dirs = rc_ls_dir (NULL, dir, 0); |
|
|
665 | char *d; |
|
|
666 | int i; |
|
|
667 | |
|
|
668 | STRLIST_FOREACH (dirs, d, i) |
|
|
669 | { |
|
|
670 | char *p = rc_strcatpaths (dir, d, (char *) NULL); |
|
|
671 | char **entries = rc_ls_dir (NULL, p, RC_LS_INITD); |
|
|
672 | char *e; |
|
|
673 | int j; |
|
|
674 | |
|
|
675 | STRLIST_FOREACH (entries, e, j) |
|
|
676 | list = rc_strlist_addsortu (list, e); |
|
|
677 | |
|
|
678 | if (entries) |
|
|
679 | free (entries); |
|
|
680 | } |
|
|
681 | |
|
|
682 | if (dirs) |
|
|
683 | free (dirs); |
|
|
684 | } |
|
|
685 | else |
|
|
686 | { |
| 659 | if (rc_is_dir (dir)) |
687 | if (rc_is_dir (dir)) |
| 660 | list = rc_ls_dir (list, dir, RC_LS_INITD); |
688 | list = rc_ls_dir (list, dir, RC_LS_INITD); |
|
|
689 | } |
| 661 | |
690 | |
| 662 | free (dir); |
691 | free (dir); |
| 663 | return (list); |
692 | return (list); |
| 664 | } |
693 | } |
| 665 | |
694 | |