SHA256
1
0
forked from pool/systemd
systemd/new-lsb-headers.patch
Frederic Crozat f54de6a28b - Update to version 41:
+ systemd binary is now installed in /lib/systemd (symlink for
  /bin/systemd is available now)
  + kernel modules are now loaded through libkmod
  + Watchdog support is now useful (not complete)
  + new kernel command line available to set system wide
    environment variable: systemd.setenv
  + journald capabilities set is now limited
  + SIGPIPE is ignored by default. This can be disabled with
    IgnoreSIGPIPE=no in unit files.
- Add fix-kmod-build.patch: fix build with libkmod
- Drop remote-fs-after-network.patch (merged upstream)
- Add dm-lvm-after-local-fs-pre-target.patch: ensure md / lvm
  /dmraid is started before mounting partitions, if fsck was
  disabled for them (bnc#733283).
- Update lsb-header patch to correctly disable heuristic if
  X-Systemd-RemainAfterExit is specified (whatever its value)
- Add fix-message-after-chkconfig.patch: don't complain if only
  sysv services are called in systemctl.
- Add is-enabled-non-existing-service.patch: fix error message when
  running is-enabled on non-existing service.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=242
2012-02-09 17:04:56 +00:00

79 lines
3.3 KiB
Diff

Index: systemd-41/src/service.c
===================================================================
--- systemd-41.orig/src/service.c
+++ systemd-41/src/service.c
@@ -119,6 +119,7 @@ static void service_init(Unit *u) {
#ifdef HAVE_SYSV_COMPAT
s->sysv_start_priority = -1;
s->sysv_start_priority_from_rcnd = -1;
+ s->sysv_remain_after_exit_heuristic = true;
#endif
s->socket_fd = -1;
s->guess_main_pid = true;
@@ -861,6 +862,34 @@ static int service_load_sysv_path(Servic
} else
state = LSB;
+ } else if (startswith_no_case(t, "PIDFile:")) {
+ char *fn;
+
+ state = LSB;
+
+ fn = strstrip(t+8);
+ if (!path_is_absolute(fn)) {
+ log_warning("[%s:%u] PID file not absolute. Ignoring.", path, line);
+ continue;
+ }
+
+ if (!(fn = strdup(fn))) {
+ r = -ENOMEM;
+ goto finish;
+ }
+
+ free(s->pid_file);
+ s->pid_file = fn;
+ s->sysv_remain_after_exit_heuristic = false;
+ s->remain_after_exit = false;
+ } else if (startswith_no_case(t, "X-Systemd-RemainAfterExit:")) {
+ char *j;
+
+ state = LSB;
+ if ((j = strstrip(t+26)) && *j) {
+ s->remain_after_exit = parse_boolean(j);
+ s->sysv_remain_after_exit_heuristic = false;
+ }
}
}
}
@@ -891,7 +920,8 @@ static int service_load_sysv_path(Servic
/* Special setting for all SysV services */
s->type = SERVICE_FORKING;
- s->remain_after_exit = !s->pid_file;
+ if (s->sysv_remain_after_exit_heuristic)
+ s->remain_after_exit = !s->pid_file;
s->guess_main_pid = false;
s->restart = SERVICE_RESTART_NO;
s->exec_context.ignore_sigpipe = false;
@@ -2030,7 +2060,7 @@ static void service_enter_running(Servic
if ((main_pid_ok > 0 || (main_pid_ok < 0 && cgroup_ok != 0)) &&
(s->bus_name_good || s->type != SERVICE_DBUS)) {
#ifdef HAVE_SYSV_COMPAT
- if (s->sysv_enabled && !s->pid_file)
+ if (s->sysv_enabled && !s->pid_file && s->sysv_remain_after_exit_heuristic)
s->remain_after_exit = false;
#endif
service_set_state(s, SERVICE_RUNNING);
Index: systemd-41/src/service.h
===================================================================
--- systemd-41.orig/src/service.h
+++ systemd-41/src/service.h
@@ -157,6 +157,7 @@ struct Service {
#ifdef HAVE_SYSV_COMPAT
bool sysv_has_lsb:1;
bool sysv_enabled:1;
+ bool sysv_remain_after_exit_heuristic:1;
int sysv_start_priority_from_rcnd;
int sysv_start_priority;