SHA256
1
0
forked from pool/systemd
systemd/new-lsb-headers.patch
Frederic Crozat 9bf0c2c838 Accepting request 96123 from home:fcrozat:systemd
- Remove storage-after-cryptsetup.service, add
  storage-after-cryptsetup.patch instead to prevent dependency
  cycle (bnc#722539).
- Add delay-fsck-cryptsetup-after-md-lvm-dmraid.patch: ensure
  fsck/cryptsetup is run after lvm/md/dmraid have landed
  (bnc#724912).
- Add cron-tty-pam.patch: Fix cron filling logs (bnc#731358).
- Add do_not_warn_pidfile.patch: Fix PID warning in logs
  (bnc#732912).
- Add mount-swap-log.patch: Ensure swap and mount output is
  redirected to default log target (rhb#750032).
- Add color-on-boot.patch: ensure colored status are displayed at
  boot time.
- Update modules_on_boot.patch to fix bnc#732041.
- Replace private_tmp_crash.patch with log_on_close.patch, better
  upstream fix for bnc#699829 and fix bnc#731719.
- Update vconsole patch to fix memleaks and crash (bnc#734527).
- Add handle-racy-daemon.patch: fix warnings with sendmail
  (bnc#732912).
- Add new-lsb-headers.patch: support PIDFile: and
  X-Systemd-RemainAfterExit: header in initscript (bnc#727771).
- Update bootsplash services to not start if vga= is missing from
  cmdline (bnc#727771)
- Add lock-opensuse.patch: disable /var/lock/{subsys,lockdev} and
  change default permissions on /var/lock (bnc#733523).
- Add garbage_collect_units: ensure error units are correctly
  garbage collected (rhb#680122).
- Add crypt-loop-file.patch: add support for crypt file loop
  (bnc#730496).

OBS-URL: https://build.opensuse.org/request/show/96123
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=228
2011-12-09 14:44:59 +00:00

66 lines
2.7 KiB
Diff

Index: systemd-37/src/service.c
===================================================================
--- systemd-37.orig/src/service.c
+++ systemd-37/src/service.c
@@ -116,6 +116,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;
@@ -805,6 +806,31 @@ 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;
+ } else if (startswith_no_case(t, "X-Systemd-RemainAfterExit:")) {
+ char *j;
+
+ state = LSB;
+ if ((j = strstrip(t+26)) && *j)
+ s->sysv_remain_after_exit_heuristic = !parse_boolean(j);
}
}
}
@@ -2017,7 +2043,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-37/src/service.h
===================================================================
--- systemd-37.orig/src/service.h
+++ systemd-37/src/service.h
@@ -139,6 +139,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;