typedef enum RunlevelType {
RUNLEVEL_UP,
RUNLEVEL_DOWN,
- RUNLEVEL_BASIC
+ RUNLEVEL_SYSINIT
} RunlevelType;
static const struct {
{ "rc6.d", SPECIAL_RUNLEVEL6_TARGET, RUNLEVEL_DOWN },
/* SUSE style boot.d */
- { "boot.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_BASIC },
+ { "boot.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
/* Debian style rcS.d */
- { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_BASIC },
+ { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
};
#define RUNLEVELS_UP "12345"
endswith(name, ".sh.service"))
return -ENOENT;
- STRV_FOREACH(p, UNIT(s)->meta.manager->sysvinit_path) {
+ STRV_FOREACH(p, UNIT(s)->meta.manager->lookup_paths.sysvinit_path) {
char *path;
int r;
/* Load service data from SysV init scripts, preferably with
* LSB headers ... */
- if (strv_isempty(UNIT(s)->meta.manager->sysvinit_path))
+ if (strv_isempty(UNIT(s)->meta.manager->lookup_paths.sysvinit_path))
return 0;
if ((t = UNIT(s)->meta.id))
if ((unsigned long) (pid_t) p != p)
return -ERANGE;
+ if (p <= 1)
+ return -ERANGE;
+
if (kill((pid_t) p, 0) < 0 && errno != EPERM) {
log_warning("PID %llu read from file %s does not exist. Your service or init script might be broken.",
(unsigned long long) p, s->pid_file);
return;
fail:
- log_warning("%s failed to run stop-post executable: %s", UNIT(s)->meta.id, strerror(-r));
+ log_warning("%s failed to run 'stop-post' task: %s", UNIT(s)->meta.id, strerror(-r));
service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
}
return;
fail:
- log_warning("%s failed to run stop executable: %s", UNIT(s)->meta.id, strerror(-r));
+ log_warning("%s failed to run 'stop' task: %s", UNIT(s)->meta.id, strerror(-r));
service_enter_signal(s, SERVICE_STOP_SIGTERM, false);
}
return;
fail:
- log_warning("%s failed to run start-post executable: %s", UNIT(s)->meta.id, strerror(-r));
+ log_warning("%s failed to run 'start-post' task: %s", UNIT(s)->meta.id, strerror(-r));
service_enter_stop(s, false);
}
return;
fail:
- log_warning("%s failed to run start exectuable: %s", UNIT(s)->meta.id, strerror(-r));
+ log_warning("%s failed to run 'start' task: %s", UNIT(s)->meta.id, strerror(-r));
service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
}
return;
fail:
- log_warning("%s failed to run start-pre executable: %s", UNIT(s)->meta.id, strerror(-r));
+ log_warning("%s failed to run 'start-pre' task: %s", UNIT(s)->meta.id, strerror(-r));
service_enter_dead(s, false, true);
}
return;
fail:
- log_warning("%s failed to run reload executable: %s", UNIT(s)->meta.id, strerror(-r));
+ log_warning("%s failed to run 'reload' task: %s", UNIT(s)->meta.id, strerror(-r));
service_enter_stop(s, false);
}
return;
fail:
- log_warning("%s failed to run spawn next executable: %s", UNIT(s)->meta.id, strerror(-r));
+ log_warning("%s failed to run spawn next task: %s", UNIT(s)->meta.id, strerror(-r));
if (s->state == SERVICE_START_PRE)
service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
assert(m);
- STRV_FOREACH(p, m->sysvrcnd_path)
+ STRV_FOREACH(p, m->lookup_paths.sysvrcnd_path)
for (i = 0; i < ELEMENTSOF(rcnd_table); i ++) {
struct dirent *de;
}
if (de->d_name[0] == 'S' &&
- (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_BASIC))
+ (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT))
SERVICE(service)->sysv_start_priority =
MAX(a*10 + b, SERVICE(service)->sysv_start_priority);
if ((r = unit_add_dependency(service, UNIT_BEFORE, runlevel_target, true)) < 0)
goto finish;
- } else if (de->d_name[0] == 'K' && rcnd_table[i].type == RUNLEVEL_DOWN) {
+ } else if (de->d_name[0] == 'K' &&
+ (rcnd_table[i].type == RUNLEVEL_DOWN ||
+ rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
Unit *shutdown_target;
/* We honour K links only for
* really distuingish here
* between the runlevels 0 and
* 6 and just add them to the
- * special shutdown target. */
+ * special shutdown target. On
+ * SUSE the boot.d/ runlevel
+ * is also used for shutdown,
+ * so we add links for that
+ * too to the shutdown
+ * target.*/
if ((r = manager_load_unit(m, SPECIAL_SHUTDOWN_TARGET, NULL, &shutdown_target)) < 0)
goto finish;