~vicamo/systemd/systemd

« back to all changes in this revision

Viewing changes to debian/patches/0002-Avoid-reloading-services-when-shutting-down.patch

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-11-06 14:01:26 UTC
  • mfrom: (6.1.21 sid)
  • Revision ID: package-import@ubuntu.com-20131106140126-176udehi2kg210w7
Tags: 204-5ubuntu1
* Merge packaging with current Debian unstable, to greatly reduce the diff
  noise. Ubuntu changes:
  Permanently Ubuntu specific:
  - debian/control, debian/rules, debian/systemd.install,
    debian/systemd-services.install: Split out systemd-services package with
    logind, timedated, hostnamed, and localed. Add
    libpam-systemd.systemd-logind.upstart to bring up logind at boot.
  - debian/rules: Don't build systemd and systemd-sysv packages, not
    approved for universe for now.
  - debian/udev.templates, Drop debconfiscation of udev, not necessary for
    Ubuntu.
  - debian/extra/initramfs.top: Drop $ROOTDELAY, we do that in a more
    sensible way with wait-for-root. (Will get applicable to Debian once
    Debian gets wait-for-root in initramfs-tools.)
  - Add debian/extra/rules/78-graphics-card.rules: Mark graphics devices as
    PRIMARY_DEVICE_FOR_DISPLAY so that we can wait for those in plymouth.
  - Drop debian/extra/{50-udev-default.rules,75-cd-aliases-generator.rules,
    80-networking.rules,91-permissions.rules}, we don't want these in
    Ubuntu.
  - Add debian/extra/udev.py: Apport hook.
  - debian/extra/udev.startup, debian/rules: Don't install/support
    /etc/udev/links.conf, that's a hack (if you want links, create udev
    rules).
  - Various debian/patches/*, see patch headers (unmergeable with Debian).
  - Drop debian/source/{git-patches,options}, we use proper patches.
  - debian/rules: We continue to use the old net iface naming schema for the
    time being. Install old udev rule generator in debian/udev.install.
    (Reconsider post-LTS)
  - debian/rules: Don't install init.d scripts, only the upstart jobs.
  - debian/rules: Add an epoch to libgudev.
  - Drop debian/udev.dirs, not necessary.
  - Drop debian/udev.NEWS, debian/udev.maintscript: Not applicable to
    Ubuntu.
  - debian/udev.{postinst,postrm,preinst,prerm}: Keep our much simpler
    versions (all platforms must support udev, no debconf).
  - debian/libgudev-1.0-0.install: Install into /lib/ (Debian has a patch
    for this to go into /usr/lib/).
  - debian/rules: Drop doc dir symlinking. It creates havoc with dpkg
    upgrades, and we already have the automatic per-file symlinking.

  Applicable to Debian:
  - debian/control, debian/tests/: Add autopkgtest.
  - debian/extra/initramfs.hook, debian/udev.*{pre,post}inst: Divert udevadm
    to udevadm.upgrade during upgrades while udev is unconfigured.
  - Add debian/extra/60-keyboard.hwdb: Latest upstream keymaps, for easy
    backporting.
  - debian/extra/initramfs.bottom: If LVM is installed, settle udev,
    otherwise we get missing LV symlinks. (LP #1185394)
  - debian/extra/rules/75-persistent-net-generator.rules: Add Ravello
    systems (LP #1099278)
  - Add debian/extra/README-{etc,lib}-rules.d documentation, install into
    udev.
  - debian/rules: Run tests during package build.
  - debian/udev.udev-finish.upstart: Fix path to tmp-rules,
    debian/extra/rule_generator.functions creates them in /run/udev/.
  - debian/udev.upstart: Fix path to udevd.
  - debian/shlibs.local: Drop libudev; this unnecessarily generates overly
    strict dependencies, and even wrong ones for our epoched libgudev.
  - debian/udev-udeb.install: Add 64-btrfs.rules and 75-probe_mtd.rules,
    they are potentially useful in a d-i environment.

  Will go away eventually:
  - Add debian/extra/rules/40-hyperv-hotadd.rules: Workaround for LP #1233466
  - Keep debian/extra/firmware.agent and rule in
    debian/extra/rules/80-drivers.rules until this has been tested to not be
    necessary under Ubuntu kernels any more.

  Upgrade fixes, keep until 14.04 LTS release:
  - debian/control: Conflicts/Replaces libpam-xdg-support.
  - debian/libpam-systemd.postinst: Trigger reboot notification for upgrade
    from < 204, due to changed cgroup layout.
  - debian/systemd-services.maintscript: Clean up obsolete
    /etc/init/systemd-logind.conf on upgrades.

* Promote "systemd | systemd-shim" to Depends. (LP: #1221809)
* 0000-upstream-hwdb-keyboard.patch: udev-builtin-keyboard: Fix large scan
  codes on 32 bit architectures. (side issue in LP #1247676)
* Drop systemd init specific Debian patches which we don't need in Ubuntu;
  The Debian package does not track proper patches any more, so it doesn't
  help us keeping the patches around for merging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From da1afe50fe0cb828982925d454db2300a8f0b7af Mon Sep 17 00:00:00 2001
2
 
From: Tollef Fog Heen <tfheen@err.no>
3
 
Date: Tue, 16 Oct 2012 18:39:27 +0200
4
 
Subject: [PATCH 02/10] Avoid reloading services when shutting down
5
 
 
6
 
Doing so won't work and makes no sense.  Thanks to Michael Stapelberg
7
 
for the patch.  Closes: #624599.
8
 
---
9
 
 src/core/manager.c |   26 ++++++++++++++++++++++++++
10
 
 1 file changed, 26 insertions(+)
11
 
 
12
 
diff --git a/src/core/manager.c b/src/core/manager.c
13
 
index c7f8f20..20e5844 100644
14
 
--- a/src/core/manager.c
15
 
+++ b/src/core/manager.c
16
 
@@ -874,6 +874,8 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) {
17
 
 int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool override, DBusError *e, Job **_ret) {
18
 
         int r;
19
 
         Transaction *tr;
20
 
+        Job *j;
21
 
+        Iterator i;
22
 
 
23
 
         assert(m);
24
 
         assert(type < _JOB_TYPE_MAX);
25
 
@@ -885,6 +887,30 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
26
 
                 return -EINVAL;
27
 
         }
28
 
 
29
 
+        if (type == JOB_RELOAD || type == JOB_RELOAD_OR_START || type == JOB_RESTART || type == JOB_TRY_RESTART) {
30
 
+                /* If final.target is queued (happens on poweroff, reboot and
31
 
+                 * halt), we will not accept new reload jobs. They would not be
32
 
+                 * executed ever anyways (since the shutdown comes first), but
33
 
+                 * they block the shutdown process: when systemd tries to stop
34
 
+                 * a unit such as ifup@eth0.service, that unit might invoke a
35
 
+                 * systemctl reload command, which blockingly waits (but only
36
 
+                 * gets executed after all other queued units for the shutdown
37
 
+                 * have been executed).
38
 
+                 *
39
 
+                 * See http://bugs.debian.org/624599 and
40
 
+                 *     http://bugs.debian.org/635777 */
41
 
+                HASHMAP_FOREACH(j, m->jobs, i) {
42
 
+                        assert(j->installed);
43
 
+
44
 
+                        if (strcmp(j->unit->id, "final.target") == 0) {
45
 
+                                log_debug("final.target is queued, ignoring %s request for unit %s", job_type_to_string(type), unit->id);
46
 
+                                dbus_set_error(e, BUS_ERROR_INVALID_JOB_MODE, "final.target is queued, ignoring %s request for unit %s", job_type_to_string(type), unit->id);
47
 
+                                return -EINVAL;
48
 
+                        }
49
 
+                }
50
 
+        }
51
 
+
52
 
+
53
 
         if (mode == JOB_ISOLATE && !unit->allow_isolate) {
54
 
                 dbus_set_error(e, BUS_ERROR_NO_ISOLATION, "Operation refused, unit may not be isolated.");
55
 
                 return -EPERM;
56
 
1.7.10.4
57