chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
manager: link ~/.local/share/systemd/session to ~/.config/systemd/session if possible
[elogind.git]
/
src
/
service.c
diff --git
a/src/service.c
b/src/service.c
index 0615b51490a4235b716839ed24cce8c02745c1e2..07b6e4e05a5dda9d3131b43e83050a1f029414e7 100644
(file)
--- a/
src/service.c
+++ b/
src/service.c
@@
-57,7
+57,7
@@
static const struct {
{ "rc5.d", SPECIAL_RUNLEVEL5_TARGET, RUNLEVEL_UP },
{ "rc6.d", SPECIAL_RUNLEVEL6_TARGET, RUNLEVEL_DOWN },
{ "rc5.d", SPECIAL_RUNLEVEL5_TARGET, RUNLEVEL_UP },
{ "rc6.d", SPECIAL_RUNLEVEL6_TARGET, RUNLEVEL_DOWN },
- /* S
u
SE style boot.d */
+ /* S
U
SE style boot.d */
{ "boot.d", SPECIAL_BASIC_TARGET, RUNLEVEL_BASIC },
/* Debian style rcS.d */
{ "boot.d", SPECIAL_BASIC_TARGET, RUNLEVEL_BASIC },
/* Debian style rcS.d */
@@
-632,11
+632,6
@@
static int service_load_sysv_path(Service *s, const char *path) {
s->valid_no_process = true;
s->kill_mode = KILL_PROCESS_GROUP;
s->valid_no_process = true;
s->kill_mode = KILL_PROCESS_GROUP;
- /* For SysV services log output should go to the console */
- s->exec_context.std_input = EXEC_INPUT_NULL;
- s->exec_context.std_output = EXEC_OUTPUT_TTY;
- s->exec_context.std_error = EXEC_OUTPUT_TTY;
-
u->meta.load_state = UNIT_LOADED;
r = 0;
u->meta.load_state = UNIT_LOADED;
r = 0;
@@
-654,6
+649,12
@@
static int service_load_sysv_name(Service *s, const char *name) {
assert(s);
assert(name);
assert(s);
assert(name);
+ /* For SysV services we strip the boot. or .sh
+ * prefixes/suffixes. */
+ if (startswith(name, "boot.") ||
+ endswith(name, ".sh.service"))
+ return -ENOENT;
+
STRV_FOREACH(p, UNIT(s)->meta.manager->sysvinit_path) {
char *path;
int r;
STRV_FOREACH(p, UNIT(s)->meta.manager->sysvinit_path) {
char *path;
int r;
@@
-667,7
+668,7
@@
static int service_load_sysv_name(Service *s, const char *name) {
r = service_load_sysv_path(s, path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
r = service_load_sysv_path(s, path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
- /* Try Debian style .sh source'able init scripts */
+ /* Try Debian style
xxx
.sh source'able init scripts */
strcat(path, ".sh");
r = service_load_sysv_path(s, path);
}
strcat(path, ".sh");
r = service_load_sysv_path(s, path);
}
@@
-675,7
+676,7
@@
static int service_load_sysv_name(Service *s, const char *name) {
free(path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
free(path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
- /* Try S
use style boot.x
xxx init scripts */
+ /* Try S
USE style boot.
xxx init scripts */
if (asprintf(&path, "%s/boot.%s", *p, name) < 0)
return -ENOMEM;
if (asprintf(&path, "%s/boot.%s", *p, name) < 0)
return -ENOMEM;
@@
-1707,7
+1708,8
@@
static int service_start(Unit *u) {
/* Make sure we don't enter a busy loop of some kind. */
if (!ratelimit_test(&s->ratelimit)) {
log_warning("%s start request repeated too quickly, refusing to start.", u->meta.id);
/* Make sure we don't enter a busy loop of some kind. */
if (!ratelimit_test(&s->ratelimit)) {
log_warning("%s start request repeated too quickly, refusing to start.", u->meta.id);
- return -EAGAIN;
+ service_enter_dead(s, false, true);
+ return -ECANCELED;
}
s->failure = false;
}
s->failure = false;