chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shorten copyright header of configuration files
[elogind.git]
/
src
/
service.c
diff --git
a/src/service.c
b/src/service.c
index dbef725ce65645a0a29d2e2027f6020145a0ebf3..2fcb304e86d7bffbcfae02627e6f5a842687d19b 100644
(file)
--- a/
src/service.c
+++ b/
src/service.c
@@
-225,7
+225,7
@@
finish:
return 1;
}
return 1;
}
-static int sysv_
chkconfig
_order(Service *s) {
+static int sysv_
fix
_order(Service *s) {
Meta *other;
int r;
Meta *other;
int r;
@@
-632,6
+632,11
@@
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;
@@
-649,6
+654,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;
@@
-662,7
+673,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);
}
@@
-670,7
+681,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 Suse style boot.xxx
x
init scripts */
+ /* Try Suse 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;
@@
-789,7
+800,7
@@
static int service_load(Unit *u) {
if ((r = unit_add_default_cgroup(u)) < 0)
return r;
if ((r = unit_add_default_cgroup(u)) < 0)
return r;
- if ((r = sysv_
chkconfig
_order(s)) < 0)
+ if ((r = sysv_
fix
_order(s)) < 0)
return r;
if (s->bus_name) {
return r;
if (s->bus_name) {