Accepting request 215598 from Base:System

- Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
  to skip already by the kernel managed devices 

- fix timeout stopping user@.service (bnc#841544)
  * 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch
  * 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch
  * 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch

- Add patch 0001-upstream-systemctl-halt-reboot-error-handling.patch
  to be able to detect if the sysctl reboot() returns.
- Add patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
  A check for unmaintained disk like devices is added to be able to
  flush and maybe shut them down.  Also the missing sync() system
  call is added for the direct halt/reboot systemctl command. Then
  the system halt is used as fallback if poweroff fails for both
  the direct poweroff systemctl command as well as for the
  systemd-shutdown utility.

- Make systemd-mini build 

- Make requires bash-completion a recommends

- Add patch 1017-skip-native-unit-handling-if-sysv-already-handled.patch
  to avoid that enabled boot scripts will be handled as unit files
  by systemctl status command (bnc#818044)

- Drop patch 1017-enforce-sufficient-shutdown-warnings.patch
  as the original code behaves exactly as the shutdown code of
  the old SysVinit (bnc#750845)
- Rename support-powerfail-with-powerstatus.patch to

OBS-URL: https://build.opensuse.org/request/show/215598
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
This commit is contained in:
Stephan Kulow 2014-01-31 12:36:06 +00:00 committed by Git OBS Bridge
commit 6610d3c57e
19 changed files with 2252 additions and 3 deletions

View File

@ -0,0 +1,537 @@
This seems to be a SUSE specific patch. Here we add the check for unmaintained
disk like devices to be able to flush and maybe shut them down. Also we add the
missing sync() system call for the direct halt/reboot systemctl command. Then we
use the system halt as gfallback if poweroff fails for both the direct poweroff
systemctl command as well as for the systemd-shutdown utility.
---
Makefile.am | 2
Makefile.in | 7
src/core/shutdown.c | 8 -
src/shared/hdflush.c | 365 ++++++++++++++++++++++++++++++++++++++++++++++
src/shared/hdflush.h | 25 +++
src/systemctl/systemctl.c | 17 +-
6 files changed, 416 insertions(+), 8 deletions(-)
--- systemd-208/Makefile.am
+++ systemd-208/Makefile.am 2014-01-28 11:06:55.638238060 +0000
@@ -680,6 +680,8 @@ libsystemd_shared_la_SOURCES = \
src/shared/strbuf.h \
src/shared/strxcpyx.c \
src/shared/strxcpyx.h \
+ src/shared/hdflush.c \
+ src/shared/hdflush.h \
src/shared/conf-parser.c \
src/shared/conf-parser.h \
src/shared/log.c \
--- systemd-208/Makefile.in
+++ systemd-208/Makefile.in 2014-01-28 11:06:33.942246196 +0000
@@ -1509,7 +1509,7 @@ am_libsystemd_shared_la_OBJECTS = src/sh
src/shared/hashmap.lo src/shared/set.lo src/shared/fdset.lo \
src/shared/prioq.lo src/shared/sleep-config.lo \
src/shared/strv.lo src/shared/env-util.lo src/shared/strbuf.lo \
- src/shared/strxcpyx.lo src/shared/conf-parser.lo \
+ src/shared/strxcpyx.lo src/shared/hdflush.lo src/shared/conf-parser.lo \
src/shared/log.lo src/shared/ratelimit.lo \
src/shared/exit-status.lo src/shared/utf8.lo \
src/shared/pager.lo src/shared/socket-util.lo \
@@ -4137,6 +4137,8 @@ libsystemd_shared_la_SOURCES = \
src/shared/strbuf.h \
src/shared/strxcpyx.c \
src/shared/strxcpyx.h \
+ src/shared/hdflush.c \
+ src/shared/hdflush.h \
src/shared/conf-parser.c \
src/shared/conf-parser.h \
src/shared/log.c \
@@ -7073,6 +7075,8 @@ src/shared/strbuf.lo: src/shared/$(am__d
src/shared/$(DEPDIR)/$(am__dirstamp)
src/shared/strxcpyx.lo: src/shared/$(am__dirstamp) \
src/shared/$(DEPDIR)/$(am__dirstamp)
+src/shared/hdflush.lo: src/shared/$(am__dirstamp) \
+ src/shared/$(DEPDIR)/$(am__dirstamp)
src/shared/conf-parser.lo: src/shared/$(am__dirstamp) \
src/shared/$(DEPDIR)/$(am__dirstamp)
src/shared/log.lo: src/shared/$(am__dirstamp) \
@@ -9236,6 +9240,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/strbuf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/strv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/strxcpyx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hdflush.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/time-dst.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/time-util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/unit-name.Plo@am__quote@
--- systemd-208/src/shared/hdflush.c
+++ systemd-208/src/shared/hdflush.c 2014-01-28 10:58:56.490735704 +0000
@@ -0,0 +1,365 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+ This file is part of systemd.
+
+ Copyright 2014 Werner Fink
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+/*
+ * Find all disks on the system, list out IDE, unmanaged ATA disks, and
+ * USB sticks flush the cache of those and optional shut them down.
+ */
+
+#include <libudev.h>
+#include <limits.h>
+#ifdef LIST_DEBUG
+# include <stdio.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include <sys/ioctl.h>
+#include <linux/hdreg.h>
+#include <linux/fs.h>
+#ifdef WORDS_BIGENDIAN
+# include <byteswap.h>
+#endif
+
+/* Used in flush_cache_ext(), compare with <linux/hdreg.h> */
+#define IDBYTES 512
+#define MASK_EXT 0xE000 /* Bit 15 shall be zero, bit 14 shall be one, bit 13 flush cache ext */
+#define TEST_EXT 0x6000
+
+/* Maybe set in list_disks() and used in do_standby_disk() */
+#define DISK_IS_IDE 0x00000001
+#define DISK_IS_SATA 0x00000002
+#define DISK_EXTFLUSH 0x00000004
+#define DISK_REMOVABLE 0x00000008
+#define DISK_MANAGED 0x00000010
+#define DISK_FLUSHONLY 0x00000020
+
+struct sysfs {
+ struct udev *udev;
+ struct udev_enumerate *num;
+ struct udev_list_entry *item;
+ char *devnode;
+ size_t size;
+};
+
+static int flush_cache_ext(const struct sysfs *sysfs);
+
+static struct sysfs * open_sysfs(void)
+{
+ static struct sysfs sysfs;
+ sysfs.udev = udev_new();
+ if (!sysfs.udev)
+ goto err;
+ sysfs.num = udev_enumerate_new(sysfs.udev);
+ if (!sysfs.num)
+ goto err;
+ if (udev_enumerate_add_match_subsystem(sysfs.num, "block") < 0)
+ goto err;
+ if (udev_enumerate_add_match_sysname(sysfs.num, "sd?") < 0)
+ goto err;
+ if (udev_enumerate_add_match_sysname(sysfs.num, "hd?") < 0)
+ goto err;
+ if (udev_enumerate_scan_devices(sysfs.num) < 0)
+ goto err;
+ sysfs.item = udev_enumerate_get_list_entry(sysfs.num);
+ sysfs.devnode = NULL;
+ sysfs.size = 0;
+ return &sysfs;
+err:
+ if (sysfs.num)
+ udev_unref(sysfs.udev);
+ if (sysfs.udev)
+ udev_unref(sysfs.udev);
+ return NULL;
+}
+
+static void close_sysfs(struct sysfs *sysfs)
+{
+ if (sysfs->num)
+ udev_enumerate_unref(sysfs->num);
+ if (sysfs->udev)
+ udev_unref(sysfs->udev);
+ if (sysfs->devnode)
+ free(sysfs->devnode);
+ sysfs->devnode = NULL;
+}
+
+
+static char *list_disks(struct sysfs *sysfs, unsigned int* flags)
+{
+ struct udev_device *device, *parent;
+ struct udev_list_entry *item;
+ const char *devnode;
+ char path[PATH_MAX];
+
+ device = NULL;
+next:
+ if (device)
+ udev_device_unref(device);
+ if (sysfs->devnode)
+ free(sysfs->devnode);
+ sysfs->devnode = NULL;
+ sysfs->size = 0;
+ *flags = 0;
+
+ if (!sysfs->item)
+ goto empty;
+ item = sysfs->item;
+ sysfs->item = udev_list_entry_get_next(sysfs->item);
+
+ if (!(device = udev_device_new_from_syspath(sysfs->udev, udev_list_entry_get_name(item))))
+ goto out;
+ if (!(devnode = udev_device_get_devnode(device)))
+ goto out;
+ if (!(sysfs->devnode = strdup(devnode)))
+ goto out;
+
+ path[0] = '\0';
+ parent = udev_device_get_parent(device);
+ if (parent) {
+ const char *sysname, *devpath;
+ struct udev_device *disk;
+ const char *value;
+ int ret;
+
+ sysname = udev_device_get_sysname(parent);
+ devpath = udev_device_get_devpath(parent);
+
+ strcpy(path, "/sys");
+ strcat(path, devpath);
+ strcat(path, "/scsi_disk/");
+ strcat(path, sysname);
+
+ disk = udev_device_new_from_syspath(sysfs->udev, path);
+ if (disk) {
+ value = udev_device_get_sysattr_value(disk, "manage_start_stop");
+ udev_device_unref(disk);
+
+ if (value && *value != '0') {
+ *flags = DISK_MANAGED;
+#ifndef LIST_DEBUG
+ goto next; /* Device managed by the kernel */
+#endif
+ }
+ }
+
+ value = udev_device_get_sysattr_value(device, "size");
+ if (value && *value)
+ sysfs->size = (size_t)atoll(value);
+
+ value = udev_device_get_sysattr_value(device, "removable");
+ if (value && *value != '0') {
+ *flags |= DISK_REMOVABLE;
+
+ if ((ret = flush_cache_ext(sysfs))) {
+ if (ret < 0)
+ goto next;
+ *flags |= DISK_EXTFLUSH;
+ }
+ goto out; /* Removable disk like USB stick */
+ }
+
+ value = udev_device_get_sysname(device);
+ if (value && *value == 'h') {
+ *flags |= DISK_IS_IDE;
+
+ if ((ret = flush_cache_ext(sysfs))) {
+ if (ret < 0)
+ goto next;
+ *flags |= DISK_EXTFLUSH;
+ }
+ goto out; /* IDE disk found */
+ }
+
+ value = udev_device_get_sysattr_value(parent, "vendor");
+ if (value && strncmp(value, "ATA", 3) == 0) {
+ *flags |= (DISK_IS_IDE|DISK_IS_SATA);
+
+ if ((ret = flush_cache_ext(sysfs))) {
+ if (ret < 0)
+ goto next;
+ *flags |= DISK_EXTFLUSH;
+ }
+ goto out; /* SATA disk to shutdown */
+ }
+ goto next;
+ }
+out:
+ udev_device_unref(device);
+empty:
+ return sysfs->devnode;
+}
+#ifndef LIST_DEBUG
+/*
+ * Check IDE/(S)ATA hard disk identity for
+ * the FLUSH CACHE EXT bit set.
+ */
+static int flush_cache_ext(const struct sysfs *sysfs)
+{
+#ifndef WIN_IDENTIFY
+#define WIN_IDENTIFY 0xEC
+#endif
+ unsigned char args[4+IDBYTES];
+ unsigned short *id = (unsigned short*)(&args[4]);
+ int fd = -1, ret = 0;
+
+ if (sysfs->size < (1<<28))
+ goto out; /* small disk */
+
+ if ((fd = open(sysfs->devnode, O_RDONLY|O_NONBLOCK|O_CLOEXEC)) < 0)
+ goto out;
+
+ memset(&args[0], 0, sizeof(args));
+ args[0] = WIN_IDENTIFY;
+ args[3] = 1;
+ if (ioctl(fd, HDIO_DRIVE_CMD, &args))
+ goto out;
+#ifdef WORDS_BIGENDIAN
+# if 0
+ {
+ const unsigned short *end = id + IDBYTES/2;
+ const unsigned short *from = id;
+ unsigned short *to = id;
+
+ while (from < end)
+ *to++ = bswap_16(*from++);
+ }
+# else
+ id[83] = bswap_16(id[83]);
+# endif
+#endif
+ if ((id[83] & MASK_EXT) == TEST_EXT)
+ ret = 1;
+out:
+ if (fd >= 0)
+ close(fd);
+ return ret;
+}
+
+/*
+ * Put an IDE/SCSI/SATA disk in standby mode.
+ * Code stolen from hdparm.c
+ */
+static int do_standby_disk(struct sysfs *sysfs, unsigned int flags)
+{
+#ifndef WIN_STANDBYNOW1
+#define WIN_STANDBYNOW1 0xE0
+#endif
+#ifndef WIN_STANDBYNOW2
+#define WIN_STANDBYNOW2 0x94
+#endif
+#ifndef WIN_FLUSH_CACHE_EXT
+#define WIN_FLUSH_CACHE_EXT 0xEA
+#endif
+#ifndef WIN_FLUSH_CACHE
+#define WIN_FLUSH_CACHE 0xE7
+#endif
+ unsigned char flush1[4] = {WIN_FLUSH_CACHE_EXT,0,0,0};
+ unsigned char flush2[4] = {WIN_FLUSH_CACHE,0,0,0};
+ unsigned char stdby1[4] = {WIN_STANDBYNOW1,0,0,0};
+ unsigned char stdby2[4] = {WIN_STANDBYNOW2,0,0,0};
+ int fd, ret;
+
+ if ((fd = open(sysfs->devnode, O_RDWR|O_NONBLOCK|O_CLOEXEC)) < 0)
+ return -1;
+
+ switch (flags & DISK_EXTFLUSH) {
+ case DISK_EXTFLUSH:
+ if ((ret = ioctl(fd, HDIO_DRIVE_CMD, &flush1)) == 0)
+ break;
+ /* Extend flush rejected, try standard flush */
+ default:
+ ret = ioctl(fd, HDIO_DRIVE_CMD, &flush2) &&
+ ioctl(fd, BLKFLSBUF);
+ break;
+ }
+
+ if ((flags & DISK_FLUSHONLY) == 0x0) {
+ ret = ioctl(fd, HDIO_DRIVE_CMD, &stdby1) &&
+ ioctl(fd, HDIO_DRIVE_CMD, &stdby2);
+ }
+
+ close(fd);
+
+ if (ret)
+ return -1;
+ return 0;
+}
+#endif
+#ifdef LIST_DEBUG
+int main()
+{
+ char *disk;
+ unsigned int flags;
+ struct sysfs *sysfs = open_sysfs();
+ if (!sysfs)
+ goto err;
+ while ((disk = list_disks(sysfs, &flags)))
+ fprintf(stdout, "%s\n", sysfs->devnode);
+ close_sysfs(sysfs);
+err:
+ return 0;
+}
+#else
+/*
+ * List all disks and put them in standby mode.
+ * This has the side-effect of flushing the writecache,
+ * which is exactly what we want on poweroff.
+ */
+void hddown(void)
+{
+ struct sysfs *sysfs;
+ unsigned int flags;
+ char *disk;
+
+ if (!(sysfs = open_sysfs()))
+ return;
+
+ while ((disk = list_disks(sysfs, &flags)))
+ do_standby_disk(sysfs, flags);
+
+ close_sysfs(sysfs);
+}
+
+/*
+ * List all disks and cause them to flush their buffers.
+ */
+void hdflush(void)
+{
+ struct sysfs *sysfs;
+ unsigned int flags;
+ char *disk;
+
+ if (!(sysfs = open_sysfs()))
+ return;
+
+ while ((disk = list_disks(sysfs, &flags)))
+ do_standby_disk(sysfs, (flags|DISK_FLUSHONLY));
+
+ close_sysfs(sysfs);
+}
+#endif
--- systemd-208/src/shared/hdflush.h
+++ systemd-208/src/shared/hdflush.h 2014-01-28 11:00:08.286235696 +0000
@@ -0,0 +1,25 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+ This file is part of systemd.
+
+ Copyright 2014 Werner Fink
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+void hdflush(void);
+void hddown(void);
--- systemd-208/src/core/shutdown.c
+++ systemd-208/src/core/shutdown.c 2014-01-28 11:14:15.722235591 +0000
@@ -40,6 +40,7 @@
#include "missing.h"
#include "log.h"
#include "fileio.h"
+#include "hdflush.h"
#include "umount.h"
#include "util.h"
#include "mkdir.h"
@@ -302,8 +303,13 @@ int main(int argc, char *argv[]) {
* on reboot(), but the file systems need to be synce'd
* explicitly in advance. So let's do this here, but not
* needlessly slow down containers. */
- if (!in_container)
+ if (!in_container) {
sync();
+ if (cmd == RB_POWER_OFF || cmd == RB_HALT_SYSTEM)
+ hddown();
+ else
+ hdflush();
+ }
if (cmd == LINUX_REBOOT_CMD_KEXEC) {
--- systemd-208/src/systemctl/systemctl.c
+++ systemd-208/src/systemctl/systemctl.c 2014-01-28 11:31:27.150735613 +0000
@@ -87,6 +87,7 @@ static bool arg_no_pager = false;
static bool arg_no_wtmp = false;
static bool arg_no_wall = false;
static bool arg_no_reload = false;
+static bool arg_no_sync = false;
static bool arg_show_types = false;
static bool arg_ignore_inhibitors = false;
static bool arg_dry = false;
@@ -5272,6 +5273,7 @@ static int halt_parse_argv(int argc, cha
{ "reboot", no_argument, NULL, ARG_REBOOT },
{ "force", no_argument, NULL, 'f' },
{ "wtmp-only", no_argument, NULL, 'w' },
+ { "no-sync", no_argument, NULL, 'n' },
{ "no-wtmp", no_argument, NULL, 'd' },
{ "no-wall", no_argument, NULL, ARG_NO_WALL },
{ NULL, 0, NULL, 0 }
@@ -5324,10 +5326,13 @@ static int halt_parse_argv(int argc, cha
case 'i':
case 'h':
- case 'n':
/* Compatibility nops */
break;
+ case 'n':
+ arg_no_sync = true;
+ break;
+
case '?':
return -EINVAL;
@@ -5981,14 +5986,14 @@ static int halt_now(enum action a) {
switch (a) {
- case ACTION_HALT:
- log_info("Halting.");
- reboot(RB_HALT_SYSTEM);
- return -errno;
-
case ACTION_POWEROFF:
log_info("Powering off.");
reboot(RB_POWER_OFF);
+ /* Fall through */
+
+ case ACTION_HALT:
+ log_info("Halting.");
+ reboot(RB_HALT_SYSTEM);
return -errno;
case ACTION_REBOOT:

View File

@ -0,0 +1,225 @@
From 6fa7e1a944a2dbb89e794ad0f9da5d0fda5dc4a9 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 29 Jan 2014 13:38:55 +0100
Subject: [PATCH 1/3] core: introduce new KillMode=mixed which sends SIGTERM
only to the main process, but SIGKILL to all daemon processes
This should fix some race with terminating systemd --user, where the
system systemd instance might race against the user systemd instance
when sending SIGTERM.
---
man/systemd.kill.xml | 77 +++++++++++++++++++++++++++++++++-----------------
src/core/kill.c | 1 +
src/core/kill.h | 1 +
src/core/unit.c | 3 +-
units/user@.service.in | 1 +
5 files changed, 56 insertions(+), 27 deletions(-)
diff --git a/man/systemd.kill.xml b/man/systemd.kill.xml
index 1b10fba..a4009aa 100644
--- a/man/systemd.kill.xml
+++ b/man/systemd.kill.xml
@@ -44,39 +44,44 @@
<refnamediv>
<refname>systemd.kill</refname>
- <refpurpose>Kill environment configuration</refpurpose>
+ <refpurpose>Process killing procedure
+ configuration</refpurpose>
</refnamediv>
<refsynopsisdiv>
<para><filename><replaceable>service</replaceable>.service</filename>,
<filename><replaceable>socket</replaceable>.socket</filename>,
<filename><replaceable>mount</replaceable>.mount</filename>,
- <filename><replaceable>swap</replaceable>.swap</filename></para>
+ <filename><replaceable>swap</replaceable>.swap</filename>,
+ <filename><replaceable>scope</replaceable>.scope</filename></para>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>Unit configuration files for services, sockets,
- mount points and swap devices share a subset of
- configuration options which define the process killing
- parameters of spawned processes.</para>
+ mount points, swap devices and scopes share a subset
+ of configuration options which define the
+ killing procedure of processes belonging to the unit.</para>
<para>This man page lists the configuration options
- shared by these four unit types. See
+ shared by these five unit types. See
<citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- for the common options of all unit configuration
- files, and
+ for the common options shared by all unit
+ configuration files, and
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- and
+ <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- for more information on the specific unit
- configuration files. The execution specific
+ and
+ <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ for more information on the configuration file options
+ specific to each unit type.</para>
+
+ <para>The kill procedure
configuration options are configured in the [Service],
- [Socket], [Mount], or [Swap] section, depending on the unit
- type.</para>
+ [Socket], [Mount] or [Swap] section, depending on the
+ unit type.</para>
</refsect1>
<refsect1>
@@ -87,32 +92,40 @@
<varlistentry>
<term><varname>KillMode=</varname></term>
<listitem><para>Specifies how
- processes of this service shall be
+ processes of this unit shall be
killed. One of
<option>control-group</option>,
<option>process</option>,
+ <option>mixed</option>,
<option>none</option>.</para>
<para>If set to
<option>control-group</option>, all
remaining processes in the control
- group of this unit will be terminated
- on unit stop (for services: after the
+ group of this unit will be killed on
+ unit stop (for services: after the
stop command is executed, as
configured with
<varname>ExecStop=</varname>). If set
to <option>process</option>, only the
main process itself is killed. If set
- to <option>none</option>, no process is
+ to <option>mixed</option> the
+ <constant>SIGTERM</constant> signal
+ (see below) is sent to the main
+ process while the subsequent
+ <constant>SIGKILL</constant> signal
+ (see below) is sent to all remaining
+ processes of the unit's control
+ group. If set to
+ <option>none</option>, no process is
killed. In this case only the stop
- command will be executed on unit
- stop, but no process be killed
+ command will be executed on unit stop,
+ but no process be killed
otherwise. Processes remaining alive
after stop are left in their control
group and the control group continues
to exist after stop unless it is
- empty. Defaults to
- <option>control-group</option>.</para>
+ empty.</para>
<para>Processes will first be
terminated via
@@ -133,14 +146,24 @@
option). See
<citerefentry><refentrytitle>kill</refentrytitle><manvolnum>2</manvolnum></citerefentry>
for more
- information.</para></listitem>
+ information.</para>
+
+ <para>Defaults to
+ <option>control-group</option>.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>KillSignal=</varname></term>
<listitem><para>Specifies which signal
- to use when killing a
- service. Defaults to <constant>SIGTERM</constant>.
+ to use when killing a service. This
+ controls the signal that is sent as
+ first step of shutting down a unit
+ (see above), and is usually followed
+ by <constant>SIGKILL</constant> (see
+ above and below). For a list of valid
+ signals, see
+ <citerefentry><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Defaults
+ to <constant>SIGTERM</constant>.
</para></listitem>
</varlistentry>
@@ -184,7 +207,9 @@
<citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>kill</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>
</para>
</refsect1>
diff --git a/src/core/kill.c b/src/core/kill.c
index ea947c2..4271346 100644
--- a/src/core/kill.c
+++ b/src/core/kill.c
@@ -52,6 +52,7 @@ void kill_context_dump(KillContext *c, FILE *f, const char *prefix) {
static const char* const kill_mode_table[_KILL_MODE_MAX] = {
[KILL_CONTROL_GROUP] = "control-group",
[KILL_PROCESS] = "process",
+ [KILL_MIXED] = "mixed",
[KILL_NONE] = "none"
};
diff --git a/src/core/kill.h b/src/core/kill.h
index 41773f0..d5f125f 100644
--- a/src/core/kill.h
+++ b/src/core/kill.h
@@ -32,6 +32,7 @@ typedef enum KillMode {
/* The kill mode is a property of a unit. */
KILL_CONTROL_GROUP = 0,
KILL_PROCESS,
+ KILL_MIXED,
KILL_NONE,
_KILL_MODE_MAX,
_KILL_MODE_INVALID = -1
diff --git a/src/core/unit.c b/src/core/unit.c
index 4b97710..0b10e57 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3007,7 +3007,7 @@ int unit_kill_context(
}
}
- if (c->kill_mode == KILL_CONTROL_GROUP && u->cgroup_path) {
+ if ((c->kill_mode == KILL_CONTROL_GROUP || (c->kill_mode == KILL_MIXED && sigkill)) && u->cgroup_path) {
_cleanup_set_free_ Set *pid_set = NULL;
/* Exclude the main/control pids from being killed via the cgroup */
@@ -3021,6 +3021,7 @@ int unit_kill_context(
log_warning_unit(u->id, "Failed to kill control group: %s", strerror(-r));
} else if (r > 0) {
wait_for_exit = true;
+
if (c->send_sighup) {
set_free(pid_set);
diff --git a/units/user@.service.in b/units/user@.service.in
index 3718a57..3bb8696 100644
--- a/units/user@.service.in
+++ b/units/user@.service.in
@@ -17,3 +17,4 @@ Environment=SHELL=%s
ExecStart=-@rootlibexecdir@/systemd --user
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket
Slice=user-%i.slice
+KillMode=mixed
--
1.8.4

View File

@ -0,0 +1,329 @@
From d420282b28f50720e233ccb1c02547c562195653 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 26 Nov 2013 01:39:53 +0100
Subject: [PATCH] core: replace OnFailureIsolate= setting by a more generic
OnFailureJobMode= setting and make use of it where applicable
---
man/systemd.unit.xml | 40 +++++++++++++++++++++++++----------
src/core/dbus-unit.c | 3 ++-
src/core/job.h | 3 +--
src/core/load-fragment-gperf.gperf.m4 | 3 ++-
src/core/load-fragment.c | 31 +++++++++++++++++++++++++++
src/core/load-fragment.h | 2 ++
src/core/unit.c | 11 +++++-----
src/core/unit.h | 4 ++--
units/initrd-cleanup.service.in | 1 +
units/initrd-fs.target | 2 +-
units/initrd-parse-etc.service.in | 1 +
units/initrd-root-fs.target | 2 +-
units/initrd-switch-root.service.in | 1 +
units/initrd.target | 2 +-
units/local-fs.target | 2 +-
15 files changed, 82 insertions(+), 26 deletions(-)
Index: systemd-208/man/systemd.unit.xml
===================================================================
--- systemd-208.orig/man/systemd.unit.xml
+++ systemd-208/man/systemd.unit.xml
@@ -669,19 +669,37 @@
</varlistentry>
<varlistentry>
- <term><varname>OnFailureIsolate=</varname></term>
+ <term><varname>OnFailureJobMode=</varname></term>
- <listitem><para>Takes a boolean
- argument. If <option>true</option>, the
- unit listed in
+ <listitem><para>Takes a value of
+ <literal>fail</literal>,
+ <literal>replace</literal>,
+ <literal>replace-irreversibly</literal>
+ or
+ <literal>isolate</literal>. Defaults
+ to
+ <literal>replace</literal>. Specifies
+ how the units listed in
<varname>OnFailure=</varname> will be
- enqueued in isolation mode, i.e. all
- units that are not its dependency will
- be stopped. If this is set, only a
+ enqueued. If set to
+ <literal>fail</literal> and
+ contradicting jobs are already queued,
+ cause the activation to fail. If set
+ to <literal>replace</literal> and
+ contradicting jobs area already
+ queued, replace
+ those. <literal>replace-irreversibly</literal>
+ is similar to
+ <literal>replace</literal>, however,
+ creates jobs that cannot be reversed
+ unless they finished or are explicitly
+ canceled. <literal>isolate</literal>
+ may be used to terminate all other
+ units but the specified one. If
+ this is set to
+ <literal>isolate</literal>, only a
single unit may be listed in
- <varname>OnFailure=</varname>. Defaults
- to
- <option>false</option>.</para></listitem>
+ <varname>OnFailure=</varname>..</para></listitem>
</varlistentry>
<varlistentry>
Index: systemd-208/src/core/dbus-unit.c
===================================================================
--- systemd-208.orig/src/core/dbus-unit.c
+++ systemd-208/src/core/dbus-unit.c
@@ -133,6 +133,7 @@ static int bus_unit_append_description(D
}
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_unit_append_load_state, unit_load_state, UnitLoadState);
+static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_unit_append_job_mode, job_mode, JobMode);
static int bus_unit_append_active_state(DBusMessageIter *i, const char *property, void *data) {
Unit *u = data;
@@ -1079,7 +1080,7 @@ const BusProperty bus_unit_properties[]
{ "RefuseManualStop", bus_property_append_bool, "b", offsetof(Unit, refuse_manual_stop) },
{ "AllowIsolate", bus_property_append_bool, "b", offsetof(Unit, allow_isolate) },
{ "DefaultDependencies", bus_property_append_bool, "b", offsetof(Unit, default_dependencies) },
- { "OnFailureIsolate", bus_property_append_bool, "b", offsetof(Unit, on_failure_isolate) },
+ { "OnFailureJobMode", bus_unit_append_job_mode, "s", offsetof(Unit, on_failure_job_mode) },
{ "IgnoreOnIsolate", bus_property_append_bool, "b", offsetof(Unit, ignore_on_isolate) },
{ "IgnoreOnSnapshot", bus_property_append_bool, "b", offsetof(Unit, ignore_on_snapshot) },
{ "NeedDaemonReload", bus_unit_append_need_daemon_reload, "b", 0 },
Index: systemd-208/src/core/job.h
===================================================================
--- systemd-208.orig/src/core/job.h
+++ systemd-208/src/core/job.h
@@ -83,7 +83,7 @@ enum JobState {
enum JobMode {
JOB_FAIL, /* Fail if a conflicting job is already queued */
JOB_REPLACE, /* Replace an existing conflicting job */
- JOB_REPLACE_IRREVERSIBLY, /* Like JOB_REPLACE + produce irreversible jobs */
+ JOB_REPLACE_IRREVERSIBLY,/* Like JOB_REPLACE + produce irreversible jobs */
JOB_ISOLATE, /* Start a unit, and stop all others */
JOB_IGNORE_DEPENDENCIES, /* Ignore both requirement and ordering dependencies */
JOB_IGNORE_REQUIREMENTS, /* Ignore requirement dependencies */
Index: systemd-208/src/core/load-fragment-gperf.gperf.m4
===================================================================
--- systemd-208.orig/src/core/load-fragment-gperf.gperf.m4
+++ systemd-208/src/core/load-fragment-gperf.gperf.m4
@@ -122,7 +122,8 @@ Unit.RefuseManualStart, config_
Unit.RefuseManualStop, config_parse_bool, 0, offsetof(Unit, refuse_manual_stop)
Unit.AllowIsolate, config_parse_bool, 0, offsetof(Unit, allow_isolate)
Unit.DefaultDependencies, config_parse_bool, 0, offsetof(Unit, default_dependencies)
-Unit.OnFailureIsolate, config_parse_bool, 0, offsetof(Unit, on_failure_isolate)
+Unit.OnFailureJobMode, config_parse_job_mode, 0, offsetof(Unit, on_failure_job_mode)
+Unit.OnFailureIsolate, config_parse_job_mode_isolate, 0, offsetof(Unit, on_failure_job_mode)
Unit.IgnoreOnIsolate, config_parse_bool, 0, offsetof(Unit, ignore_on_isolate)
Unit.IgnoreOnSnapshot, config_parse_bool, 0, offsetof(Unit, ignore_on_snapshot)
Unit.JobTimeoutSec, config_parse_sec, 0, offsetof(Unit, job_timeout)
Index: systemd-208/src/core/load-fragment.c
===================================================================
--- systemd-208.orig/src/core/load-fragment.c
+++ systemd-208/src/core/load-fragment.c
@@ -2314,6 +2314,36 @@ int config_parse_blockio_bandwidth(
return 0;
}
+DEFINE_CONFIG_PARSE_ENUM(config_parse_job_mode, job_mode, JobMode, "Failed to parse job mode");
+
+int config_parse_job_mode_isolate(
+ const char *unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ JobMode *m = data;
+ int r;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+
+ r = parse_boolean(rvalue);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Failed to parse boolean, ignoring: %s", rvalue);
+ return 0;
+ }
+
+ *m = r ? JOB_ISOLATE : JOB_REPLACE;
+ return 0;
+}
+
#define FOLLOW_MAX 8
static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
Index: systemd-208/src/core/load-fragment.h
===================================================================
--- systemd-208.orig/src/core/load-fragment.h
+++ systemd-208/src/core/load-fragment.h
@@ -83,6 +83,8 @@ int config_parse_device_allow(const char
int config_parse_blockio_weight(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_blockio_device_weight(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_blockio_bandwidth(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_job_mode(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_job_mode_isolate(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
/* gperf prototypes */
const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length);
Index: systemd-208/src/core/unit.c
===================================================================
--- systemd-208.orig/src/core/unit.c
+++ systemd-208/src/core/unit.c
@@ -85,6 +85,7 @@ Unit *unit_new(Manager *m, size_t size)
u->deserialized_job = _JOB_TYPE_INVALID;
u->default_dependencies = true;
u->unit_file_state = _UNIT_FILE_STATE_INVALID;
+ u->on_failure_job_mode = JOB_REPLACE;
return u;
}
@@ -807,14 +808,14 @@ void unit_dump(Unit *u, FILE *f, const c
"%s\tRefuseManualStart: %s\n"
"%s\tRefuseManualStop: %s\n"
"%s\tDefaultDependencies: %s\n"
- "%s\tOnFailureIsolate: %s\n"
+ "%s\tOnFailureJobMode: %s\n"
"%s\tIgnoreOnIsolate: %s\n"
"%s\tIgnoreOnSnapshot: %s\n",
prefix, yes_no(u->stop_when_unneeded),
prefix, yes_no(u->refuse_manual_start),
prefix, yes_no(u->refuse_manual_stop),
prefix, yes_no(u->default_dependencies),
- prefix, yes_no(u->on_failure_isolate),
+ prefix, job_mode_to_string(u->on_failure_job_mode),
prefix, yes_no(u->ignore_on_isolate),
prefix, yes_no(u->ignore_on_snapshot));
@@ -985,11 +986,11 @@ int unit_load(Unit *u) {
if (r < 0)
goto fail;
- if (u->on_failure_isolate &&
+ if (u->on_failure_job_mode == JOB_ISOLATE &&
set_size(u->dependencies[UNIT_ON_FAILURE]) > 1) {
log_error_unit(u->id,
- "More than one OnFailure= dependencies specified for %s but OnFailureIsolate= enabled. Refusing.", u->id);
+ "More than one OnFailure= dependencies specified for %s but OnFailureJobMode=isolate set. Refusing.", u->id);
r = -EINVAL;
goto fail;
@@ -1394,7 +1395,7 @@ void unit_start_on_failure(Unit *u) {
SET_FOREACH(other, u->dependencies[UNIT_ON_FAILURE], i) {
int r;
- r = manager_add_job(u->manager, JOB_START, other, u->on_failure_isolate ? JOB_ISOLATE : JOB_REPLACE, true, NULL, NULL);
+ r = manager_add_job(u->manager, JOB_START, other, u->on_failure_job_mode, true, NULL, NULL);
if (r < 0)
log_error_unit(u->id, "Failed to enqueue OnFailure= job: %s", strerror(-r));
}
Index: systemd-208/src/core/unit.h
===================================================================
--- systemd-208.orig/src/core/unit.h
+++ systemd-208/src/core/unit.h
@@ -228,8 +228,8 @@ struct Unit {
/* Allow isolation requests */
bool allow_isolate;
- /* Isolate OnFailure unit */
- bool on_failure_isolate;
+ /* How to start OnFailure units */
+ JobMode on_failure_job_mode;
/* Ignore this unit when isolating */
bool ignore_on_isolate;
Index: systemd-208/units/initrd-cleanup.service.in
===================================================================
--- systemd-208.orig/units/initrd-cleanup.service.in
+++ systemd-208/units/initrd-cleanup.service.in
@@ -10,6 +10,7 @@ Description=Cleaning Up and Shutting Dow
DefaultDependencies=no
ConditionPathExists=/etc/initrd-release
OnFailure=emergency.target
+OnFailureJobMode=replace-irreversibly
After=initrd-root-fs.target initrd-fs.target initrd.target
[Service]
Index: systemd-208/units/initrd-fs.target
===================================================================
--- systemd-208.orig/units/initrd-fs.target
+++ systemd-208/units/initrd-fs.target
@@ -9,7 +9,7 @@
Description=Initrd File Systems
Documentation=man:systemd.special(7)
OnFailure=emergency.target
-OnFailureIsolate=yes
+OnFailureJobMode=replace-irreversibly
ConditionPathExists=/etc/initrd-release
After=initrd-parse-etc.service
DefaultDependencies=no
Index: systemd-208/units/initrd-parse-etc.service.in
===================================================================
--- systemd-208.orig/units/initrd-parse-etc.service.in
+++ systemd-208/units/initrd-parse-etc.service.in
@@ -11,6 +11,7 @@ DefaultDependencies=no
Requires=initrd-root-fs.target
After=initrd-root-fs.target
OnFailure=emergency.target
+OnFailureJobMode=replace-irreversibly
ConditionPathExists=/etc/initrd-release
[Service]
Index: systemd-208/units/initrd-root-fs.target
===================================================================
--- systemd-208.orig/units/initrd-root-fs.target
+++ systemd-208/units/initrd-root-fs.target
@@ -10,6 +10,6 @@ Description=Initrd Root File System
Documentation=man:systemd.special(7)
ConditionPathExists=/etc/initrd-release
OnFailure=emergency.target
-OnFailureIsolate=yes
+OnFailureJobMode=replace-irreversibly
DefaultDependencies=no
Conflicts=shutdown.target
Index: systemd-208/units/initrd-switch-root.service.in
===================================================================
--- systemd-208.orig/units/initrd-switch-root.service.in
+++ systemd-208/units/initrd-switch-root.service.in
@@ -10,6 +10,7 @@ Description=Switch Root
DefaultDependencies=no
ConditionPathExists=/etc/initrd-release
OnFailure=emergency.target
+OnFailureJobMode=replace-irreversibly
AllowIsolate=yes
[Service]
Index: systemd-208/units/initrd.target
===================================================================
--- systemd-208.orig/units/initrd.target
+++ systemd-208/units/initrd.target
@@ -9,7 +9,7 @@
Description=Initrd Default Target
Documentation=man:systemd.special(7)
OnFailure=emergency.target
-OnFailureIsolate=yes
+OnFailureJobMode=replace-irreversibly
ConditionPathExists=/etc/initrd-release
Requires=basic.target
Wants=initrd-root-fs.target initrd-fs.target initrd-parse-etc.service
Index: systemd-208/units/local-fs.target
===================================================================
--- systemd-208.orig/units/local-fs.target
+++ systemd-208/units/local-fs.target
@@ -12,4 +12,4 @@ After=local-fs-pre.target
DefaultDependencies=no
Conflicts=shutdown.target
OnFailure=emergency.target
-OnFailureIsolate=no
+OnFailureJobMode=replace-irreversibly

View File

@ -0,0 +1,85 @@
--- systemd-208/src/core/shutdown.c
+++ systemd-208/src/core/shutdown.c 2014-01-27 11:31:38.486235816 +0000
@@ -329,6 +329,9 @@ int main(int argc, char *argv[]) {
reboot(cmd);
+ if (cmd == RB_POWER_OFF)
+ reboot(RB_HALT_SYSTEM);
+
if (errno == EPERM && in_container) {
/* If we are in a container, and we lacked
* CAP_SYS_BOOT just exit, this will kill our
--- systemd-208/src/systemctl/systemctl.c
+++ systemd-208/src/systemctl/systemctl.c 2014-01-27 11:05:18.298236035 +0000
@@ -138,7 +138,7 @@ static bool arg_plain = false;
static bool private_bus = false;
static int daemon_reload(DBusConnection *bus, char **args);
-static void halt_now(enum action a);
+static int halt_now(enum action a);
static void pager_open_if_enabled(void) {
@@ -2227,7 +2227,7 @@ static int start_special(DBusConnection
(a == ACTION_HALT ||
a == ACTION_POWEROFF ||
a == ACTION_REBOOT))
- halt_now(a);
+ return halt_now(a);
if (arg_force >= 1 &&
(a == ACTION_HALT ||
@@ -5973,7 +5973,7 @@ done:
return 0;
}
-static _noreturn_ void halt_now(enum action a) {
+static int halt_now(enum action a) {
/* Make sure C-A-D is handled by the kernel from this
* point on... */
@@ -5984,23 +5984,22 @@ static _noreturn_ void halt_now(enum act
case ACTION_HALT:
log_info("Halting.");
reboot(RB_HALT_SYSTEM);
- break;
+ return -errno;
case ACTION_POWEROFF:
log_info("Powering off.");
reboot(RB_POWER_OFF);
- break;
+ return -errno;
case ACTION_REBOOT:
log_info("Rebooting.");
reboot(RB_AUTOBOOT);
- break;
+ return -errno;
default:
- assert_not_reached("Unknown halt action.");
+ assert_not_reached("Unknown action.");
+ return -ENOSYS;
}
-
- assert_not_reached("Uh? This shouldn't happen.");
}
static int halt_main(DBusConnection *bus) {
@@ -6069,9 +6068,10 @@ static int halt_main(DBusConnection *bus
if (arg_dry)
return 0;
- halt_now(arg_action);
- /* We should never reach this. */
- return -ENOSYS;
+ r = halt_now(arg_action);
+ log_error("Failed to reboot: %s", strerror(-r));
+
+ return r;
}
static int runlevel_main(void) {

View File

@ -0,0 +1,62 @@
From 95d57e7b631a2d78b9b5d841125194052895470f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 29 Jan 2014 13:49:54 +0100
Subject: [PATCH 2/3] service: allow KillMode=mixed in conjunction with
PAMName=
---
src/core/service.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/core/service.c b/src/core/service.c
index 6792024..e7f03e1 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1105,37 +1105,31 @@ static int service_verify(Service *s) {
return 0;
if (!s->exec_command[SERVICE_EXEC_START]) {
- log_error_unit(UNIT(s)->id,
- "%s lacks ExecStart setting. Refusing.", UNIT(s)->id);
+ log_error_unit(UNIT(s)->id, "%s lacks ExecStart setting. Refusing.", UNIT(s)->id);
return -EINVAL;
}
if (s->type != SERVICE_ONESHOT &&
s->exec_command[SERVICE_EXEC_START]->command_next) {
- log_error_unit(UNIT(s)->id,
- "%s has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
+ log_error_unit(UNIT(s)->id, "%s has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
return -EINVAL;
}
if (s->type == SERVICE_ONESHOT && s->restart != SERVICE_RESTART_NO) {
- log_error_unit(UNIT(s)->id,
- "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
+ log_error_unit(UNIT(s)->id, "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id);
return -EINVAL;
}
if (s->type == SERVICE_DBUS && !s->bus_name) {
- log_error_unit(UNIT(s)->id,
- "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id);
+ log_error_unit(UNIT(s)->id, "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id);
return -EINVAL;
}
if (s->bus_name && s->type != SERVICE_DBUS)
- log_warning_unit(UNIT(s)->id,
- "%s has a D-Bus service name specified, but is not of type dbus. Ignoring.", UNIT(s)->id);
+ log_warning_unit(UNIT(s)->id, "%s has a D-Bus service name specified, but is not of type dbus. Ignoring.", UNIT(s)->id);
- if (s->exec_context.pam_name && s->kill_context.kill_mode != KILL_CONTROL_GROUP) {
- log_error_unit(UNIT(s)->id,
- "%s has PAM enabled. Kill mode must be set to 'control-group'. Refusing.", UNIT(s)->id);
+ if (s->exec_context.pam_name && !(s->kill_context.kill_mode == KILL_CONTROL_GROUP || s->kill_context.kill_mode == KILL_MIXED)) {
+ log_error_unit(UNIT(s)->id, "%s has PAM enabled. Kill mode must be set to 'control-group' or 'mixed'. Refusing.", UNIT(s)->id);
return -EINVAL;
}
--
1.8.4

View File

@ -0,0 +1,128 @@
From b2ffdc8da536cd88a305f97517f356e2c5383a52 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 29 Jan 2014 14:58:04 +0100
Subject: [PATCH 3/3] core: make sure to always go through both SIGTERM and
SIGKILL states of units
Given that we now have KillMode=mixed where SIGTERM might kill a smaller
set than SIGKILL we need to make sure to always go explicitly throught
the SIGKILL state to get the right end result.
---
src/core/mount.c | 8 +++++++-
src/core/scope.c | 4 +++-
src/core/service.c | 10 +++++++---
src/core/socket.c | 6 +++++-
src/core/swap.c | 6 +++++-
5 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/core/mount.c b/src/core/mount.c
index 3d46557..e418d09 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -854,8 +854,14 @@ static void mount_enter_signal(Mount *m, MountState state, MountResult f) {
goto fail;
mount_set_state(m, state);
- } else if (state == MOUNT_REMOUNTING_SIGTERM || state == MOUNT_REMOUNTING_SIGKILL)
+ } else if (state == MOUNT_REMOUNTING_SIGTERM)
+ mount_enter_signal(m, MOUNT_REMOUNTING_SIGKILL, MOUNT_SUCCESS);
+ else if (state == MOUNT_REMOUNTING_SIGKILL)
mount_enter_mounted(m, MOUNT_SUCCESS);
+ else if (state == MOUNT_MOUNTING_SIGTERM)
+ mount_enter_signal(m, MOUNT_MOUNTING_SIGKILL, MOUNT_SUCCESS);
+ else if (state == MOUNT_UNMOUNTING_SIGTERM)
+ mount_enter_signal(m, MOUNT_UNMOUNTING_SIGKILL, MOUNT_SUCCESS);
else
mount_enter_dead(m, MOUNT_SUCCESS);
diff --git a/src/core/scope.c b/src/core/scope.c
index 50e5dba..3a5c95e 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -221,7 +221,9 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) {
}
scope_set_state(s, state);
- } else
+ } else if (state == SCOPE_STOP_SIGTERM)
+ scope_enter_signal(s, SCOPE_STOP_SIGKILL, SCOPE_SUCCESS);
+ else
scope_enter_dead(s, SCOPE_SUCCESS);
return;
diff --git a/src/core/service.c b/src/core/service.c
index e7f03e1..4b481c2 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1964,10 +1964,9 @@ static void service_enter_stop_post(Service *s, ServiceResult f) {
if (r < 0)
goto fail;
-
service_set_state(s, SERVICE_STOP_POST);
} else
- service_enter_dead(s, SERVICE_SUCCESS, true);
+ service_enter_signal(s, SERVICE_FINAL_SIGTERM, SERVICE_SUCCESS);
return;
@@ -1993,6 +1992,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
s->main_pid,
s->control_pid,
s->main_pid_alien);
+
if (r < 0)
goto fail;
@@ -2005,8 +2005,12 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f
}
service_set_state(s, state);
- } else if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGKILL)
+ } else if (state == SERVICE_STOP_SIGTERM)
+ service_enter_signal(s, SERVICE_STOP_SIGKILL, SERVICE_SUCCESS);
+ else if (state == SERVICE_STOP_SIGKILL)
service_enter_stop_post(s, SERVICE_SUCCESS);
+ else if (state == SERVICE_FINAL_SIGTERM)
+ service_enter_signal(s, SERVICE_FINAL_SIGKILL, SERVICE_SUCCESS);
else
service_enter_dead(s, SERVICE_SUCCESS, true);
diff --git a/src/core/socket.c b/src/core/socket.c
index 6c0ac1a..831876f 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1298,8 +1298,12 @@ static void socket_enter_signal(Socket *s, SocketState state, SocketResult f) {
goto fail;
socket_set_state(s, state);
- } else if (state == SOCKET_STOP_PRE_SIGTERM || state == SOCKET_STOP_PRE_SIGKILL)
+ } else if (state == SOCKET_STOP_PRE_SIGTERM)
+ socket_enter_signal(s, SOCKET_STOP_PRE_SIGKILL, SOCKET_SUCCESS);
+ else if (state == SOCKET_STOP_PRE_SIGKILL)
socket_enter_stop_post(s, SOCKET_SUCCESS);
+ else if (state == SOCKET_FINAL_SIGTERM)
+ socket_enter_signal(s, SOCKET_FINAL_SIGKILL, SOCKET_SUCCESS);
else
socket_enter_dead(s, SOCKET_SUCCESS);
diff --git a/src/core/swap.c b/src/core/swap.c
index a68ab7c..8886fe8 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -655,7 +655,11 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) {
goto fail;
swap_set_state(s, state);
- } else
+ } else if (state == SWAP_ACTIVATING_SIGTERM)
+ swap_enter_signal(s, SWAP_ACTIVATING_SIGKILL, SWAP_SUCCESS);
+ else if (state == SWAP_DEACTIVATING_SIGTERM)
+ swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, SWAP_SUCCESS);
+ else
swap_enter_dead(s, SWAP_SUCCESS);
return;
--
1.8.4

View File

@ -0,0 +1,90 @@
--- systemd-208/units/sigpwr.target
+++ systemd-208/units/sigpwr.target 2014-01-14 15:53:32.878735762 +0000
@@ -8,3 +8,5 @@
[Unit]
Description=Power Failure
Documentation=man:systemd.special(7)
+BindsTo=powerfail.service
+DefaultDependencies=no
+RefuseManualStart=yes
--- systemd-208/units/powerfail.service
+++ systemd-208/units/powerfail.service 2014-01-14 16:11:41.802235712 +0000
@@ -0,0 +1,21 @@
+# This file is part of systemd.
+#
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Germany.
+# Author: Werner Fink
+# Please send feedback to http://www.suse.de/feedback
+#
+# Description:
+#
+# Used to start the systemd-powerfail.service
+#
+
+[Unit]
+Description=powerfail handling
+BindsTo=sigpwr.target
+DefaultDependencies=no
+RefuseManualStart=yes
+
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/systemd/systemd-powerfail
+RemainAfterExit=false
--- systemd-208/man/systemd-powerfail.service.8
+++ systemd-208/man/systemd-powerfail.service.8 2014-01-14 18:22:21.286735810 +0000
@@ -0,0 +1,54 @@
+'\" t
+.TH "SYSTEMD\-POWERFAIL\&.SERVICE" "8" "" "systemd 208" "systemd-powerfail.service"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+systemd-powerfail.service, systemd-powerfail \- Power Fail signal handling
+.SH "SYNOPSIS"
+.PP
+systemd\-powerfail\&.service
+.PP
+/usr/lib/systemd/systemd\-powerfail
+.SH "DESCRIPTION"
+.PP
+systemd\-powerfail
+is a system service that is used to evaulate the content of
+\fI/var/run/powerstatus\fR. Based on the content of this
+file:
+.IP F(AIL)
+Power is failing, UPS is providing the power. The
+systemd\-powerfail
+is now doing a timed shutdown.
+.IP O(K)
+The power has been restored, and pending shutdown
+will be cancled.
+.IP L(OW)
+The power is failing and the UPS has a low battery.
+The
+systemd\-powerfail
+is doing an immediate shutdown.
+.PP
+If \fI/var/run/powerstatus\fR doesn't exist or contains anything else then the letters
+F, O or L, systemd\-powerfail will behave as if it has read the letter F.
+.PP
+.SH "SEE ALSO"
+.PP
+\fBshutdown\fR(8),
+\fBpowerd\fR(8)

View File

@ -0,0 +1,20 @@
For bnc#818044
Based on http://cgit.freedesktop.org/systemd/systemd/patch/?id=67d6621059085963a2a908a3ea99ced3b0ca789e
---
systemctl.c | 5 +++++
1 file changed, 5 insertions(+)
--- systemd-208/src/systemctl/systemctl.c
+++ systemd-208/src/systemctl/systemctl.c 2014-01-21 13:00:52.910736187 +0000
@@ -4453,6 +4453,11 @@ static int enable_unit(DBusConnection *b
if (r < 0)
return r;
+ /* If the operation was fully executed by the SysV compat,
+ * let's finish early */
+ if (strv_isempty(mangled_names))
+ return 0;
+
if (!bus || avoid_bus()) {
if (streq(verb, "enable")) {
r = unit_file_enable(arg_scope, arg_runtime, arg_root, mangled_names, arg_force, &changes, &n_changes);

View File

@ -0,0 +1,51 @@
--- systemd-208/src/core/service.c
+++ systemd-208/src/core/service.c 2014-01-17 12:15:52.527311588 +0000
@@ -380,6 +380,8 @@ static int sysv_translate_facility(const
"remote_fs", SPECIAL_REMOTE_FS_TARGET,
"syslog", NULL,
"time", SPECIAL_TIME_SYNC_TARGET,
+ "all", SPECIAL_DEFAULT_TARGET,
+ "null", NULL,
};
unsigned i;
@@ -389,7 +391,7 @@ static int sysv_translate_facility(const
assert(name);
assert(_r);
- n = *name == '$' ? name + 1 : name;
+ n = (*name == '$' || *name == '+') ? name + 1 : name;
for (i = 0; i < ELEMENTSOF(table); i += 2) {
@@ -816,10 +818,13 @@ static int service_load_sysv_path(Servic
startswith_no_case(t, "Should-Start:") ||
startswith_no_case(t, "X-Start-Before:") ||
startswith_no_case(t, "X-Start-After:")) {
+ UnitDependency d, e;
char *i, *w;
size_t z;
state = LSB;
+ d = startswith_no_case(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER;
+ e = startswith_no_case(t, "Required-Start:") ? UNIT_REQUIRES_OVERRIDABLE : UNIT_WANTS;
FOREACH_WORD_QUOTED(w, z, strchr(t, ':')+1, i) {
char *n, *m;
@@ -838,12 +843,15 @@ static int service_load_sysv_path(Servic
continue;
}
+ if (*n == '+')
+ e = UNIT_WANTS;
+
free(n);
if (r == 0)
continue;
- r = unit_add_dependency_by_name(u, startswith_no_case(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER, m, NULL, true);
+ r = unit_add_two_dependencies_by_name(u, d, e, m, NULL, true);
if (r < 0)
log_error_unit(u->id, "[%s:%u] Failed to add dependency on %s, ignoring: %s",

View File

@ -0,0 +1,236 @@
--- systemd-208/shell-completion/bash/hostnamectl
+++ systemd-208/shell-completion/bash/hostnamectl 2014-01-17 14:27:16.183272019 +0000
@@ -30,6 +30,10 @@ _hostnamectl() {
local OPTS='-h --help --version --transient --static --pretty
--no-ask-password -H --host'
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
if [[ $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
@@ -58,4 +62,4 @@ _hostnamectl() {
return 0
}
-complete -F _hostnamectl hostnamectl
+complete -o default -o bashdefault -F _hostnamectl hostnamectl
--- systemd-208/shell-completion/bash/journalctl
+++ systemd-208/shell-completion/bash/journalctl 2014-01-17 14:34:30.338737694 +0000
@@ -49,6 +49,10 @@ _journalctl() {
--verify-key'
)
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
case $prev in
--boot|--this-boot|-b)
@@ -107,4 +111,4 @@ _journalctl() {
fi
}
-complete -F _journalctl journalctl
+complete -o default -o bashdefault -F _journalctl journalctl
--- systemd-208/shell-completion/bash/kernel-install
+++ systemd-208/shell-completion/bash/kernel-install 2014-01-17 14:34:41.982255874 +0000
@@ -18,11 +18,22 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+__contains_word () {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
_kernel_install() {
local comps
local MACHINE_ID
local cur=${COMP_WORDS[COMP_CWORD]}
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
case $COMP_CWORD in
1)
comps="add remove"
@@ -47,4 +58,4 @@ _kernel_install() {
return 0
}
-complete -F _kernel_install kernel-install
+complete -o default -o bashdefault -F _kernel_install kernel-install
--- systemd-208/shell-completion/bash/localectl
+++ systemd-208/shell-completion/bash/localectl 2014-01-17 14:34:52.546235747 +0000
@@ -30,6 +30,10 @@ _localectl() {
local OPTS='-h --help --version --no-convert --no-pager --no-ask-password
-H --host'
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
if __contains_word "$prev" $OPTS; then
case $prev in
--host|-H)
@@ -73,4 +77,4 @@ _localectl() {
return 0
}
-complete -F _localectl localectl
+complete -o default -o bashdefault -F _localectl localectl
--- systemd-208/shell-completion/bash/loginctl
+++ systemd-208/shell-completion/bash/loginctl 2014-01-17 14:35:03.386245699 +0000
@@ -37,6 +37,10 @@ _loginctl () {
[ARG]='--host -H --kill-who --property -p --signal -s'
)
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--signal|-s)
@@ -106,4 +110,4 @@ _loginctl () {
return 0
}
-complete -F _loginctl loginctl
+complete -o default -o bashdefault -F _loginctl loginctl
--- systemd-208/shell-completion/bash/systemctl
+++ systemd-208/shell-completion/bash/systemctl 2014-01-17 14:35:26.506235666 +0000
@@ -77,6 +77,10 @@ _systemctl () {
[ARG]='--host -H --kill-mode --kill-who --property -p --signal -s --type -t --state --root'
)
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
if __contains_word "--user" ${COMP_WORDS[*]}; then
mode=--user
else
@@ -226,4 +230,4 @@ _systemctl () {
return 0
}
-complete -F _systemctl systemctl
+complete -o default -o bashdefault -F _systemctl systemctl
--- systemd-208/shell-completion/bash/systemd-analyze
+++ systemd-208/shell-completion/bash/systemd-analyze 2014-01-17 14:35:38.366736021 +0000
@@ -37,6 +37,10 @@ _systemd_analyze() {
[LOG_LEVEL]='set-log-level'
)
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
_init_completion || return
for ((i=0; $i <= $COMP_CWORD; i++)); do
@@ -83,4 +87,4 @@ _systemd_analyze() {
return 0
}
-complete -F _systemd_analyze systemd-analyze
+complete -o default -o bashdefault -F _systemd_analyze systemd-analyze
--- systemd-208/shell-completion/bash/systemd-coredumpctl
+++ systemd-208/shell-completion/bash/systemd-coredumpctl 2014-01-17 14:35:46.434235632 +0000
@@ -44,6 +44,10 @@ _coredumpctl() {
[DUMP]='dump gdb'
)
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
if __contains_word "$prev" '--output -o'; then
comps=$( compgen -A file -- "$cur" )
compopt -o filenames
@@ -82,4 +86,4 @@ _coredumpctl() {
return 0
}
-complete -F _coredumpctl systemd-coredumpctl
+complete -o default -o bashdefault -F _coredumpctl systemd-coredumpctl
--- systemd-208/shell-completion/bash/systemd-run
+++ systemd-208/shell-completion/bash/systemd-run 2014-01-17 14:35:55.938236298 +0000
@@ -17,6 +17,13 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+__contains_word () {
+ local w word=$1; shift
+ for w in "$@"; do
+ [[ $w = "$word" ]] && return
+ done
+}
+
__systemctl() {
local mode=$1; shift 1
systemctl $mode --full --no-legend "$@"
@@ -31,6 +38,11 @@ _systemd_run() {
local mode=--system
local i
+
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
for (( i=1; i <= COMP_CWORD; i++ )); do
if [[ ${COMP_WORDS[i]} != -* ]]; then
local root_command=${COMP_WORDS[i]}
@@ -60,4 +72,4 @@ _systemd_run() {
return 0
}
-complete -F _systemd_run systemd-run
+complete -o default -o bashdefault -F _systemd_run systemd-run
--- systemd-208/shell-completion/bash/timedatectl
+++ systemd-208/shell-completion/bash/timedatectl 2014-01-17 14:36:06.182735466 +0000
@@ -30,6 +30,10 @@ _timedatectl() {
local OPTS='-h --help --version --adjust-system-clock --no-pager
--no-ask-password -H --host'
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
if __contains_word "$prev" $OPTS; then
case $prev in
--host|-H)
@@ -73,4 +77,4 @@ _timedatectl() {
return 0
}
-complete -F _timedatectl timedatectl
+complete -o default -o bashdefault -F _timedatectl timedatectl
--- systemd-208/shell-completion/bash/udevadm
+++ systemd-208/shell-completion/bash/udevadm 2014-01-17 14:36:16.406236120 +0000
@@ -36,6 +36,10 @@ _udevadm() {
local verbs=(info trigger settle control monitor hwdb test-builtin test)
+ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then
+ return 0
+ fi
+
for ((i=0; i <= COMP_CWORD; i++)); do
if __contains_word "${COMP_WORDS[i]}" "${verbs[@]}" &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
@@ -94,4 +98,4 @@ _udevadm() {
return 0
}
-complete -F _udevadm udevadm
+complete -o default -o bashdefault -F _udevadm udevadm

View File

@ -0,0 +1,35 @@
From da6de8a55784115451582051c8da620056994a05 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Mon, 20 Jan 2014 11:05:22 +0100
Subject: [PATCH] analyze: fix crash in command line parsing
Ensure DBusError is set before it can possibly be freed on return.
Fix crash when calling set-log-level without any parameter.
Fix https://bugzilla.novell.com/show_bug.cgi?id=859365
---
src/analyze/systemd-analyze.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c
index 27d063c..cdfae93 100644
--- a/src/analyze/systemd-analyze.c
+++ b/src/analyze/systemd-analyze.c
@@ -1226,13 +1226,13 @@ static int set_log_level(DBusConnection *bus, char **args) {
assert(bus);
assert(args);
+ dbus_error_init(&error);
if (strv_length(args) != 1) {
log_error("This command expects one argument only.");
return -E2BIG;
}
value = args[0];
- dbus_error_init(&error);
m = dbus_message_new_method_call("org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
--
1.8.4

View File

@ -46,6 +46,13 @@ if [ $FIRST_ARG -eq 1 ]; then \
touch "/var/lib/systemd/migrated/$sysv_service" || : \
done \
else \
if [ $FIRST_ARG -gt 1 ]; then \
for service in %{?*} ; do \
if [ ! -e "/usr/lib/systemd/system/$service" ]; then \
touch "/run/rpm-%{name}-update-$service-new-in-upgrade" \
fi \
done \
fi \
for service in %{?*} ; do \
sysv_service=${service%.*} \
if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \
@ -74,6 +81,13 @@ if [ -n "$services_to_migrate" ]; then \
/usr/sbin/systemd-sysv-convert --apply $services_to_migrate >/dev/null 2>&1 || : \
elif [ $FIRST_ARG -eq 1 ]; then \
/usr/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \
elif [ $FIRST_ARG -gt 1 ]; then \
for service in %{?*} ; do \
if [ -e "/run/rpm-%{name}-update-$service-new-in-upgrade" ]; then \
rm -f "/run/rpm-%{name}-update-$service-new-in-upgrade" \
/usr/bin/systemctl preset "$service" >/dev/null 2>&1 || : \
fi \
done \
fi \
%{nil}

View File

@ -0,0 +1,22 @@
If after emergency service had been started there is incoming
traffic on syslog.socket emergency.service gets killed due to
implicit dependencies on basic.target => sysinit.target which in
turn conflict with emergency.target.
As a workaround explicitly stop syslog.socket when entering
emergency.service.
Reference: bnc#852232
Index: systemd-208/units/emergency.service.in
===================================================================
--- systemd-208/units/emergency.service.in
+++ systemd-208/units/emergency.service.in
@@ -9,7 +9,7 @@
Description=Emergency Shell
Documentation=man:sulogin(8)
DefaultDependencies=no
-Conflicts=shutdown.target
+Conflicts=shutdown.target syslog.socket
Before=shutdown.target
[Service]

View File

@ -1,3 +1,138 @@
-------------------------------------------------------------------
Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de
- Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
to skip already by the kernel managed devices
-------------------------------------------------------------------
Wed Jan 29 18:03:39 UTC 2014 - arvidjaar@gmail.com
- fix timeout stopping user@.service (bnc#841544)
* 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch
* 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch
* 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch
-------------------------------------------------------------------
Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de
- Add patch 0001-upstream-systemctl-halt-reboot-error-handling.patch
to be able to detect if the sysctl reboot() returns.
- Add patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
A check for unmaintained disk like devices is added to be able to
flush and maybe shut them down. Also the missing sync() system
call is added for the direct halt/reboot systemctl command. Then
the system halt is used as fallback if poweroff fails for both
the direct poweroff systemctl command as well as for the
systemd-shutdown utility.
-------------------------------------------------------------------
Thu Jan 23 13:24:53 UTC 2014 - werner@suse.de
- Make systemd-mini build
-------------------------------------------------------------------
Thu Jan 23 13:18:39 UTC 2014 - werner@suse.de
- Make requires bash-completion a recommends
-------------------------------------------------------------------
Tue Jan 21 13:05:59 UTC 2014 - werner@suse.de
- Add patch 1017-skip-native-unit-handling-if-sysv-already-handled.patch
to avoid that enabled boot scripts will be handled as unit files
by systemctl status command (bnc#818044)
-------------------------------------------------------------------
Tue Jan 21 12:51:20 UTC 2014 - werner@suse.de
- Drop patch 1017-enforce-sufficient-shutdown-warnings.patch
as the original code behaves exactly as the shutdown code of
the old SysVinit (bnc#750845)
- Rename support-powerfail-with-powerstatus.patch to
1016-support-powerfail-with-powerstatus.patch
-------------------------------------------------------------------
Mon Jan 20 10:18:20 UTC 2014 - fcrozat@suse.com
- Add analyze-fix-crash-in-command-line-parsing.patch: fix crash in
systemd-analyze (bnc#859365)
-------------------------------------------------------------------
Fri Jan 17 16:09:24 UTC 2014 - werner@suse.de
- Add patch
1019-make-completion-smart-to-be-able-to-redirect.patch
to make redirections work with the bash command completions for
for systemd command tools (bnc#856858, bnc#859072)
-------------------------------------------------------------------
Fri Jan 17 12:24:13 UTC 2014 - werner@suse.de
- Add patch
1018-Make-LSB-Skripts-know-about-Required-and-Should.patch
to support the "+" to tag wanted dependencies as well as make
sure that required dependencies are handles as required ones.
This should fix bnc#858864 and bnc#857204.
-------------------------------------------------------------------
Thu Jan 16 16:08:00 UTC 2014 - lnussel@suse.de
- apply preset also to service files that are new in upgrade
-------------------------------------------------------------------
Wed Jan 15 14:11:02 UTC 2014 - werner@suse.de
- Change support-powerfail-with-powerstatus.patch to use BindsTo
instead of BindTo
-------------------------------------------------------------------
Wed Jan 15 12:34:53 UTC 2014 - werner@suse.de
- Add patch 1017-enforce-sufficient-shutdown-warnings.patch
Warn once per hour in the last 3 hours, then all 30 minutes in last
hour, all 15 minutes in the last 45 minutes, all 10 minutes in the
last 15 minutes, and then all minute in the last 10 minutes (bnc#750845)
-------------------------------------------------------------------
Tue Jan 14 18:28:09 UTC 2014 - werner@suse.de
- Add patch support-powerfail-with-powerstatus.patch and source
file systemd-powerfail to implement SIGPWR support with evaluation
of the file /var/run/powerstatus (bnc#737690)
-------------------------------------------------------------------
Fri Dec 20 12:06:18 UTC 2013 - werner@suse.de
- Adapt patch
1011-check-4-valid-kmsg-device.patch
to fit current upstream version maybe related to bnc#854884
- Change patch
1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch
to check if XDG_RUNTIME_DIR is set before the call of pam_putenv()
may fix bnc#855160
-------------------------------------------------------------------
Fri Dec 20 09:40:01 UTC 2013 - lbsousajr@gmail.com
- Disable multi-seat-x build, since package xorg-x11-server
currently in Factory no longer needs it.
-------------------------------------------------------------------
Wed Dec 18 18:56:01 UTC 2013 - hrvoje.senjan@gmail.com
- Added 0001-logind-garbage-collect-stale-users.patch: Don't stop a
running user manager from garbage-collecting the user. Original
behavior caused bnc#849870
-------------------------------------------------------------------
Mon Dec 16 11:08:33 UTC 2013 - lbsousajr@gmail.com
- Add build-sys-make-multi-seat-x-optional.patch
* See: http://cgit.freedesktop.org/systemd/systemd/commit/?id=bd441fa27a22b7c6e11d9330560e0622fb69f297
* Now systemd-multi-seat-x build can be disabled with configure option
--disable-multi-seat-x. It should be done when xorg-x11-server
no longer needs it (work in progress).
-------------------------------------------------------------------
Mon Dec 16 09:43:29 UTC 2013 - fcrozat@suse.com
@ -16,6 +151,19 @@ Fri Dec 6 13:30:19 UTC 2013 - werner@suse.de
the systemd-journald (bnc#838475)
- Let us build require the package config for libpcre (bnc#853293)
-------------------------------------------------------------------
Sat Nov 30 08:16:02 UTC 2013 - arvidjaar@gmail.com
- Add patch
0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch
Make sure emergency shell is not killed by attempt to start another unit
(bnc#852021). Backported from d420282b28f50720e233ccb1c02547c562195653.
- Add patch
make-emergency.service-conflict-with-syslog.socket.patch
Previous patch did not fix problem if syslog connection request came
after emergency shell was already started. So forcibly stop syslog.socket
when starting emergency.service. (bnc#852232)
-------------------------------------------------------------------
Thu Nov 28 10:25:58 UTC 2013 - lbsousajr@gmail.com

View File

@ -1,7 +1,7 @@
#
# spec file for package systemd-mini
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -23,6 +23,11 @@
%define udevpkgname udev-mini
%define udev_major 1
%if 0%{?sles_version} == 0
%global with_bash_completion 1
%endif
%bcond_with bash_completion
Name: systemd-mini
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 208
@ -89,6 +94,9 @@ Conflicts: kiwi
# the buildignore is important for bootstrapping
#!BuildIgnore: udev
Requires: %{udevpkgname} >= 172
%if %{with bash_completion}
Recommends: bash-completion
%endif
Requires: dbus-1 >= 1.4.0
Requires: kbd
Requires: kmod >= 14
@ -117,6 +125,7 @@ Source8: systemd-journald.init
Source9: nss-myhostname-config
Source10: macros.systemd.upstream
Source11: after-local.service
Source12: systemd-powerfail
Source1060: boot.udev
Source1061: write_dev_root_rule
@ -246,6 +255,22 @@ Patch79: 0001-analyze-set-white-background.patch
Patch80: 0001-analyze-set-text-on-side-with-most-space.patch
# PATCH-FIX-UPSTREAM 0001-logind-garbage-collect-stale-users.patch -- Don't stop a running user manager from garbage-collecting the user.
Patch81: 0001-logind-garbage-collect-stale-users.patch
# PATCH-FIX-UPSTREAM analyze-fix-crash-in-command-line-parsing.patch fcrozat@suse.com bnc#859365 -- Fix crash in systemd-analyze
Patch82: analyze-fix-crash-in-command-line-parsing.patch
# PATCH-FIX-UPSTREAM 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch -- Prevent accidental kill of emergency shell (bnc#852021)
Patch83: 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch
# PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232)
Patch84: make-emergency.service-conflict-with-syslog.socket.patch
# PATCH-FIX-UPSTREAM 0001-upstream-systemctl-halt-reboot-error-handling.patch
Patch85: 0001-upstream-systemctl-halt-reboot-error-handling.patch
# PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
Patch86: 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
# PATCH-FIX-UPSTREAM 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch -- Allow sending SIGTERM to main PID only (bnc#841544)
Patch87: 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch
# PATCH-FIX-UPSTREAM 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch -- Allow using it with PAM enabled services (bnc#841544)
Patch88: 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch
# PATCH-FIX-UPSTREAM 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch -- Make sure final SIGKILL actually kills everything (bnc#841544)
Patch89: 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch
# udev patches
# PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch
@ -276,6 +301,14 @@ Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch
Patch1014: 1014-journald-with-journaling-FS.patch
# PATCH-FIX-UPSTREAM build-sys-make-multi-seat-x-optional.patch
Patch1015: build-sys-make-multi-seat-x-optional.patch
# PATCH-FIX-SUSE 1016-support-powerfail-with-powerstatus.patch
Patch1016: 1016-support-powerfail-with-powerstatus.patch
# PATCH-FIX-UPSTREAM 1017-skip-native-unit-handling-if-sysv-already-handled.patch
Patch1017: 1017-skip-native-unit-handling-if-sysv-already-handled.patch
# PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch
Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch
# PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch
Patch1019: 1019-make-completion-smart-to-be-able-to-redirect.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -539,6 +572,14 @@ cp %{SOURCE7} m4/
%patch79 -p1
%patch80 -p1
%patch81 -p1
%patch82 -p1
%patch83 -p1
%patch84 -p1
%patch85 -p1
%patch86 -p1
%patch87 -p1
%patch88 -p1
%patch89 -p1
# udev patches
%patch1001 -p1
@ -558,6 +599,10 @@ cp %{SOURCE7} m4/
%patch1013 -p1
%patch1014 -p1
%patch1015 -p1
%patch1016 -p1
%patch1017 -p1
%patch1018 -p1
%patch1019 -p1
# ensure generate files are removed
rm -f units/emergency.service
@ -735,6 +780,23 @@ EOF
install -m 644 %{S:11} %{buildroot}/%{_prefix}/lib/systemd/system/
ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-user.target.wants/
# support for SIGPWR handling with /var/run/powerstatus of e.g. powerd
install -m 755 %{S:12} %{buildroot}/%{_prefix}/lib/systemd/
install -m 644 units/powerfail.service %{buildroot}/%{_prefix}/lib/systemd/system/
%if ! 0%{?bootstrap}
install -m 644 man/systemd-powerfail.service.8 %{buildroot}/%{_mandir}/man8/
%endif
# clean out some completions which requires bash-completion package
%if %{without bash_completion}
for c in %{buildroot}/%{_datadir}/bash-completion/completions/*
do
test -e "$c" || continue
grep -q _init_completion "$c" || continue
rm -vf "$c"
done
%endif
%fdupes -s %{buildroot}%{_mandir}
# packaged in systemd-rpm-macros

28
systemd-powerfail Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash
#
# /usr/lib/systemd/systemd-powerfail
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Germany.
# Author: Werner Fink
# Please send feedback to http://www.suse.de/feedback
#
# Description:
#
# Used to evaluate the status of /var/run/powerstatus
#
trap "echo" SIGINT SIGSEGV SIGTERM
POWERFAIL='THE POWER IS FAILED! SYSTEM GOING DOWN! PLEASE LOG OFF NOW!'
POWERFAILNOW='THE POWER IS FAILED! LOW BATTERY - EMERGENCY SYSTEM SHUTDOWN!'
POWERISBACK='THE POWER IS BACK'
typeset pwrstat=0
test -s /var/run/powerstatus && read pwrstat < /var/run/powerstatus
rm -f /var/run/powerstatus
case "$pwrstat" in
O*) exec /sbin/shutdown -c +0 "$POWERISBACK" ;;
L*) exec /sbin/shutdown -P +0 "$POWERFAILNOW" ;;
*) exec /sbin/shutdown -P +2 "$POWERFAIL" ;;
esac

View File

@ -1,7 +1,7 @@
#
# spec file for package systemd-rpm-macros
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed

View File

@ -1,3 +1,105 @@
-------------------------------------------------------------------
Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de
- Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
to skip already by the kernel managed devices
-------------------------------------------------------------------
Wed Jan 29 18:03:39 UTC 2014 - arvidjaar@gmail.com
- fix timeout stopping user@.service (bnc#841544)
* 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch
* 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch
* 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch
-------------------------------------------------------------------
Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de
- Add patch 0001-upstream-systemctl-halt-reboot-error-handling.patch
to be able to detect if the sysctl reboot() returns.
- Add patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
A check for unmaintained disk like devices is added to be able to
flush and maybe shut them down. Also the missing sync() system
call is added for the direct halt/reboot systemctl command. Then
the system halt is used as fallback if poweroff fails for both
the direct poweroff systemctl command as well as for the
systemd-shutdown utility.
-------------------------------------------------------------------
Thu Jan 23 13:24:53 UTC 2014 - werner@suse.de
- Make systemd-mini build
-------------------------------------------------------------------
Thu Jan 23 13:18:39 UTC 2014 - werner@suse.de
- Make requires bash-completion a recommends
-------------------------------------------------------------------
Tue Jan 21 13:05:59 UTC 2014 - werner@suse.de
- Add patch 1017-skip-native-unit-handling-if-sysv-already-handled.patch
to avoid that enabled boot scripts will be handled as unit files
by systemctl status command (bnc#818044)
-------------------------------------------------------------------
Tue Jan 21 12:51:20 UTC 2014 - werner@suse.de
- Drop patch 1017-enforce-sufficient-shutdown-warnings.patch
as the original code behaves exactly as the shutdown code of
the old SysVinit (bnc#750845)
- Rename support-powerfail-with-powerstatus.patch to
1016-support-powerfail-with-powerstatus.patch
-------------------------------------------------------------------
Mon Jan 20 10:18:20 UTC 2014 - fcrozat@suse.com
- Add analyze-fix-crash-in-command-line-parsing.patch: fix crash in
systemd-analyze (bnc#859365)
-------------------------------------------------------------------
Fri Jan 17 16:09:24 UTC 2014 - werner@suse.de
- Add patch
1019-make-completion-smart-to-be-able-to-redirect.patch
to make redirections work with the bash command completions for
for systemd command tools (bnc#856858, bnc#859072)
-------------------------------------------------------------------
Fri Jan 17 12:24:13 UTC 2014 - werner@suse.de
- Add patch
1018-Make-LSB-Skripts-know-about-Required-and-Should.patch
to support the "+" to tag wanted dependencies as well as make
sure that required dependencies are handles as required ones.
This should fix bnc#858864 and bnc#857204.
-------------------------------------------------------------------
Thu Jan 16 16:08:00 UTC 2014 - lnussel@suse.de
- apply preset also to service files that are new in upgrade
-------------------------------------------------------------------
Wed Jan 15 14:11:02 UTC 2014 - werner@suse.de
- Change support-powerfail-with-powerstatus.patch to use BindsTo
instead of BindTo
-------------------------------------------------------------------
Wed Jan 15 12:34:53 UTC 2014 - werner@suse.de
- Add patch 1017-enforce-sufficient-shutdown-warnings.patch
Warn once per hour in the last 3 hours, then all 30 minutes in last
hour, all 15 minutes in the last 45 minutes, all 10 minutes in the
last 15 minutes, and then all minute in the last 10 minutes (bnc#750845)
-------------------------------------------------------------------
Tue Jan 14 18:28:09 UTC 2014 - werner@suse.de
- Add patch support-powerfail-with-powerstatus.patch and source
file systemd-powerfail to implement SIGPWR support with evaluation
of the file /var/run/powerstatus (bnc#737690)
-------------------------------------------------------------------
Fri Dec 20 12:06:18 UTC 2013 - werner@suse.de
@ -49,6 +151,19 @@ Fri Dec 6 13:30:19 UTC 2013 - werner@suse.de
the systemd-journald (bnc#838475)
- Let us build require the package config for libpcre (bnc#853293)
-------------------------------------------------------------------
Sat Nov 30 08:16:02 UTC 2013 - arvidjaar@gmail.com
- Add patch
0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch
Make sure emergency shell is not killed by attempt to start another unit
(bnc#852021). Backported from d420282b28f50720e233ccb1c02547c562195653.
- Add patch
make-emergency.service-conflict-with-syslog.socket.patch
Previous patch did not fix problem if syslog connection request came
after emergency shell was already started. So forcibly stop syslog.socket
when starting emergency.service. (bnc#852232)
-------------------------------------------------------------------
Thu Nov 28 10:25:58 UTC 2013 - lbsousajr@gmail.com

View File

@ -1,7 +1,7 @@
#
# spec file for package systemd
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -21,6 +21,11 @@
%define udevpkgname udev
%define udev_major 1
%if 0%{?sles_version} == 0
%global with_bash_completion 1
%endif
%bcond_with bash_completion
Name: systemd
Url: http://www.freedesktop.org/wiki/Software/systemd
Version: 208
@ -84,6 +89,9 @@ Conflicts: kiwi
# the buildignore is important for bootstrapping
#!BuildIgnore: udev
Requires: %{udevpkgname} >= 172
%if %{with bash_completion}
Recommends: bash-completion
%endif
Requires: dbus-1 >= 1.4.0
Requires: kbd
Requires: kmod >= 14
@ -112,6 +120,7 @@ Source8: systemd-journald.init
Source9: nss-myhostname-config
Source10: macros.systemd.upstream
Source11: after-local.service
Source12: systemd-powerfail
Source1060: boot.udev
Source1061: write_dev_root_rule
@ -241,6 +250,22 @@ Patch79: 0001-analyze-set-white-background.patch
Patch80: 0001-analyze-set-text-on-side-with-most-space.patch
# PATCH-FIX-UPSTREAM 0001-logind-garbage-collect-stale-users.patch -- Don't stop a running user manager from garbage-collecting the user.
Patch81: 0001-logind-garbage-collect-stale-users.patch
# PATCH-FIX-UPSTREAM analyze-fix-crash-in-command-line-parsing.patch fcrozat@suse.com bnc#859365 -- Fix crash in systemd-analyze
Patch82: analyze-fix-crash-in-command-line-parsing.patch
# PATCH-FIX-UPSTREAM 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch -- Prevent accidental kill of emergency shell (bnc#852021)
Patch83: 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch
# PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232)
Patch84: make-emergency.service-conflict-with-syslog.socket.patch
# PATCH-FIX-UPSTREAM 0001-upstream-systemctl-halt-reboot-error-handling.patch
Patch85: 0001-upstream-systemctl-halt-reboot-error-handling.patch
# PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
Patch86: 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch
# PATCH-FIX-UPSTREAM 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch -- Allow sending SIGTERM to main PID only (bnc#841544)
Patch87: 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch
# PATCH-FIX-UPSTREAM 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch -- Allow using it with PAM enabled services (bnc#841544)
Patch88: 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch
# PATCH-FIX-UPSTREAM 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch -- Make sure final SIGKILL actually kills everything (bnc#841544)
Patch89: 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch
# udev patches
# PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch
@ -271,6 +296,14 @@ Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch
Patch1014: 1014-journald-with-journaling-FS.patch
# PATCH-FIX-UPSTREAM build-sys-make-multi-seat-x-optional.patch
Patch1015: build-sys-make-multi-seat-x-optional.patch
# PATCH-FIX-SUSE 1016-support-powerfail-with-powerstatus.patch
Patch1016: 1016-support-powerfail-with-powerstatus.patch
# PATCH-FIX-UPSTREAM 1017-skip-native-unit-handling-if-sysv-already-handled.patch
Patch1017: 1017-skip-native-unit-handling-if-sysv-already-handled.patch
# PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch
Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch
# PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch
Patch1019: 1019-make-completion-smart-to-be-able-to-redirect.patch
%description
Systemd is a system and service manager, compatible with SysV and LSB
@ -534,6 +567,14 @@ cp %{SOURCE7} m4/
%patch79 -p1
%patch80 -p1
%patch81 -p1
%patch82 -p1
%patch83 -p1
%patch84 -p1
%patch85 -p1
%patch86 -p1
%patch87 -p1
%patch88 -p1
%patch89 -p1
# udev patches
%patch1001 -p1
@ -553,6 +594,10 @@ cp %{SOURCE7} m4/
%patch1013 -p1
%patch1014 -p1
%patch1015 -p1
%patch1016 -p1
%patch1017 -p1
%patch1018 -p1
%patch1019 -p1
# ensure generate files are removed
rm -f units/emergency.service
@ -730,6 +775,23 @@ EOF
install -m 644 %{S:11} %{buildroot}/%{_prefix}/lib/systemd/system/
ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-user.target.wants/
# support for SIGPWR handling with /var/run/powerstatus of e.g. powerd
install -m 755 %{S:12} %{buildroot}/%{_prefix}/lib/systemd/
install -m 644 units/powerfail.service %{buildroot}/%{_prefix}/lib/systemd/system/
%if ! 0%{?bootstrap}
install -m 644 man/systemd-powerfail.service.8 %{buildroot}/%{_mandir}/man8/
%endif
# clean out some completions which requires bash-completion package
%if %{without bash_completion}
for c in %{buildroot}/%{_datadir}/bash-completion/completions/*
do
test -e "$c" || continue
grep -q _init_completion "$c" || continue
rm -vf "$c"
done
%endif
%fdupes -s %{buildroot}%{_mandir}
# packaged in systemd-rpm-macros