diffstat of debian/ for systemd_229-4 systemd_229-4ubuntu4 changelog | 77 +++++ control | 10 extra/initramfs-tools/hooks/udev | 2 extra/rules/73-idrac.rules | 4 extra/rules/73-special-net-names.rules | 9 gbp.conf | 3 libpam-systemd.maintscript | 1 patches/Install-correctly-report-symlink-creations.patch | 44 ++ patches/Provide-shutdown-fallback-for-upstart.patch | 90 +++++ patches/Support-system-image-read-only-etc.patch | 153 ++++++++++ patches/rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_RULES_.patch | 30 + patches/series | 8 patches/systemctl-Don-t-forward-telinit-u-to-upstart.patch | 36 ++ patches/udev-Don-t-kill-peer-processes-if-we-don-t-run-in-a-cgrou.patch | 26 + systemd.postinst | 17 + tests/cmdline-upstart-boot | 2 tests/unit-config | 100 +++++- udev-udeb.install | 2 udev.maintscript | 2 udev.postinst | 29 + 20 files changed, 616 insertions(+), 29 deletions(-) diff -Nru systemd-229/debian/changelog systemd-229/debian/changelog --- systemd-229/debian/changelog 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/changelog 2016-04-12 10:06:37.000000000 +0000 @@ -1,3 +1,80 @@ +systemd (229-4ubuntu4) xenial; urgency=medium + + * 73-special-net-names.rules: Further refine ibmveth naming. + + -- Martin Pitt Tue, 12 Apr 2016 12:06:30 +0200 + +systemd (229-4ubuntu3) xenial; urgency=medium + + * debian/tests/cmdline-upstart-boot: In test_rsyslog(), check for messages + from dbus instead of NetworkManager. NM 1.2 does not seem to log to syslog + by default any more. + * 73-special-net-names.rules: Refine ibmveth naming. + + -- Martin Pitt Tue, 12 Apr 2016 10:43:34 +0200 + +systemd (229-4ubuntu2) xenial; urgency=medium + + * debian/tests/unit-config: Call "daemon-reload" to clean up generated units + in between tests. + * debian/tests/unit-config: Check that enable/disable commands are + idempotent. + * debian/tests/unit-config: Detect if system units are in /usr/, so that the + test works on systems with merged /usr. + * debian/tests/unit-config: Use systemd-sysv-install instead of update-rc.d + directly, so that the test works under Fedora too. + * debian/tests/unit-config: Check disabling of a "systemctl link"ed unit, + and check "systemctl enable" on a unit with full path which is not in the + standard directories. + * Rename debian/extra/rules/73-idrac.rules to 73-special-net-names.rules, as + it is going to get rules for other devices. Also install it into the + initramfs. + * debian/extra/rules/73-special-net-names.rules: Add DEVPATH number based + naming schema for ibmveth devices. (LP: #1561096) + * Don't set SYSTEMD_READY=0 on DM_UDEV_DISABLE_OTHER_RULES_FLAG=1 devmapper + devices with "change" events, as this causes spurious unmounting with + multipath devices. (LP: #1565969) + * Fix bogus "No [Install] section" warning when enabling a unit with full + path. (LP: #1563590) + + -- Martin Pitt Tue, 12 Apr 2016 09:17:35 +0200 + +systemd (229-4ubuntu1) xenial; urgency=medium + + * Merge with Debian unstable. Remaining Ubuntu changes: + - Hack to support system-image read-only /etc, and modify files in + /etc/writable/ instead. + + Upgrade fixes, keep until 16.04 LTS release: + - systemd Conflicts/Replaces/Provides systemd-services. + - Remove obsolete systemd-logind upstart job. + - Clean up obsolete /etc/udev/rules.d/README. + - systemd.postinst: Migrate mountall specific fstab options to standard + util-linux "nofail" option. + - systemctl: Don't forward telinit u to upstart. This works around + upstart's Restart() always reexec'ing /sbin/init on Restart(), even if + that changes to point to systemd during the upgrade. This avoids running + systemd during a dist-upgrade. (LP: #1430479) + - Provide shutdown fallback for upstart. (LP: #1370329) + - Break lvm (<< 2.02.133-1ubuntu1) and remove our dummy /etc/init.d/lvm2 + on upgrades, as it's shipped by lvm2 now. + - Make udev break on mdadm << 3.3-2ubuntu3, as udev's init script dropped + the "Provides: raid-mdadm". + - Clean up /var/log/udev on upgrade (which is written under upstart, but + not under systemd). (LP: #1537211) + - Migrate existing s390x network configuration to new names. (LP: #1526808) + - systemd.postinst: Bump Version comparison for migrating the UTC setting + from /etc/default/rcS to /etc/adjtime, to run it for upgrades to 16.04. + - VMWare BIOS reports implausibly high onboard numbers. This got fixed in + upstream commit 6c1e69f9. Migrate names in ifupdown accordingly. + (LP: #1550539) + - udev: Don't kill peer processes if we don't run in a cgroup. This happens + when running under/upgrading from upstart. udevd and everything else run + in the root hierarchy on all controllers then, and the alleged cleanup of + "our" cgroup becomes a system-wide killing spree. (LP: #1555237) + + -- Martin Pitt Thu, 07 Apr 2016 09:53:25 +0200 + systemd (229-4) unstable; urgency=medium * Fix assertion crash when processing a (broken) device without a sysfs diff -Nru systemd-229/debian/control systemd-229/debian/control --- systemd-229/debian/control 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/control 2016-04-12 10:06:37.000000000 +0000 @@ -1,7 +1,8 @@ Source: systemd Section: admin Priority: optional -Maintainer: Debian systemd Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian systemd Maintainers Uploaders: Michael Biebl , Marco d'Itri , Sjoerd Simons , @@ -73,7 +74,10 @@ ifupdown (<< 0.8.5~), udev (<< 228-5), Replaces: udev (<< 228-5), -Conflicts: klogd + systemd-services, +Conflicts: klogd, + systemd-services, +Provides: systemd-services Description: system and service manager systemd is a system and service manager for Linux. It provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting @@ -306,6 +310,8 @@ bash-completion (<< 1:2.1), systemd (<< 224-2), ifupdown (<< 0.8.5~), + lvm2 (<< 2.02.133-1ubuntu1), + mdadm (<< 3.3-2ubuntu3), Replaces: bash-completion (<< 1:2.1), systemd (<< 224-2) Description: /dev/ and hotplug management daemon diff -Nru systemd-229/debian/extra/initramfs-tools/hooks/udev systemd-229/debian/extra/initramfs-tools/hooks/udev --- systemd-229/debian/extra/initramfs-tools/hooks/udev 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/extra/initramfs-tools/hooks/udev 2016-04-12 10:06:37.000000000 +0000 @@ -32,7 +32,7 @@ mkdir -p $DESTDIR/lib/udev/rules.d/ for rules in 50-firmware.rules 50-udev-default.rules 60-persistent-storage.rules \ - 61-persistent-storage-android.rules 75-net-description.rules \ + 61-persistent-storage-android.rules 73-special-net-names.rules 75-net-description.rules \ 80-net-setup-link.rules 80-drivers.rules; do if [ -e /etc/udev/rules.d/$rules ]; then cp -p /etc/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/ diff -Nru systemd-229/debian/extra/rules/73-idrac.rules systemd-229/debian/extra/rules/73-idrac.rules --- systemd-229/debian/extra/rules/73-idrac.rules 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/extra/rules/73-idrac.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -# On Dell PowerEdge systems, the iDRAC7 and later support a USB Virtual NIC -# which terminates in the iDRAC. Help identify this with 'idrac' -ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="a102", NAME="idrac" - diff -Nru systemd-229/debian/extra/rules/73-special-net-names.rules systemd-229/debian/extra/rules/73-special-net-names.rules --- systemd-229/debian/extra/rules/73-special-net-names.rules 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/extra/rules/73-special-net-names.rules 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1,9 @@ +# On Dell PowerEdge systems, the iDRAC7 and later support a USB Virtual NIC +# which terminates in the iDRAC. Help identify this with 'idrac' +ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="a102", NAME="idrac" + +# ibmveth devices' $DEVPATH number is tied to (virtual) hardware (slot id +# selected in the HMC), thus this provides a reliable naming (e. g. +# "/devices/vio/30000002/net/eth1"); we ignore the bus number, as +# there should only ever be one bus, and then remove leading zeros +ACTION=="add", SUBSYSTEM=="net", NAME=="", DRIVERS=="ibmveth", PROGRAM="/bin/sh -ec 'D=${DEVPATH#*/vio/}; D=${D%%%%/*}; D=${D#????}; D=${D#0}; D=${D#0}; D=${D#0}; D=${D#0}; echo ${D:-0}'", NAME="ibmveth$result" diff -Nru systemd-229/debian/gbp.conf systemd-229/debian/gbp.conf --- systemd-229/debian/gbp.conf 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/gbp.conf 2016-04-12 10:06:37.000000000 +0000 @@ -1,4 +1,5 @@ [DEFAULT] pristine-tar = True patch-numbers = False -debian-branch = master +debian-branch = ubuntu +debian-tag = ubuntu/%(version)s diff -Nru systemd-229/debian/libpam-systemd.maintscript systemd-229/debian/libpam-systemd.maintscript --- systemd-229/debian/libpam-systemd.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/libpam-systemd.maintscript 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1 @@ +rm_conffile /etc/init/systemd-logind.conf 204-9ubuntu1~ libpam-systemd diff -Nru systemd-229/debian/patches/Install-correctly-report-symlink-creations.patch systemd-229/debian/patches/Install-correctly-report-symlink-creations.patch --- systemd-229/debian/patches/Install-correctly-report-symlink-creations.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/patches/Install-correctly-report-symlink-creations.patch 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1,44 @@ +From: Martin Pitt +Date: Mon, 11 Apr 2016 21:03:29 +0200 +Subject: Install: correctly report symlink creations + +All callers of create_symlink(), such as install_info_symlink_wants(), expect +that to return > 0 if it actually did something, and then return that number. +unit_file_enable() uses that to determine if any action was done +(carries_install_info != 0) and if not, show a "The unit files have no +[Install] section" warning. + +Return 1 instead of 0 in the two code paths of create_symlink() when the link +was created or replaced with a new value. + +This fixes getting a bogus "No [Install] section" warning when enabling a unit +with full path, like "systemctl enable /some/path/myunit.service". + +Bug-Ubuntu: https://launchpad.net/bugs/1563590 +Forwarded: https://github.com/systemd/systemd/pull/3016 +--- + src/shared/install.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/shared/install.c b/src/shared/install.c +index ef8f485..0f08137 100644 +--- a/src/shared/install.c ++++ b/src/shared/install.c +@@ -294,7 +294,7 @@ static int create_symlink( + + if (symlink(old_path, new_path) >= 0) { + unit_file_changes_add(changes, n_changes, UNIT_FILE_SYMLINK, new_path, old_path); +- return 0; ++ return 1; + } + + if (errno != EEXIST) +@@ -317,7 +317,7 @@ static int create_symlink( + unit_file_changes_add(changes, n_changes, UNIT_FILE_UNLINK, new_path, NULL); + unit_file_changes_add(changes, n_changes, UNIT_FILE_SYMLINK, new_path, old_path); + +- return 0; ++ return 1; + } + + static int mark_symlink_for_removal( diff -Nru systemd-229/debian/patches/Provide-shutdown-fallback-for-upstart.patch systemd-229/debian/patches/Provide-shutdown-fallback-for-upstart.patch --- systemd-229/debian/patches/Provide-shutdown-fallback-for-upstart.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/patches/Provide-shutdown-fallback-for-upstart.patch 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1,90 @@ +From: Martin Pitt +Date: Wed, 17 Sep 2014 09:31:13 +0200 +Subject: Provide shutdown fallback for upstart + +For reboot/poweroff/halt/shutdown, if the running init is neither systemd nor +sysvinit, check if we are running under upstart and provide a telinit 0/6 +fallback in that case. We call telinit to avoid reimplementing all that logic +with plain D-BUS commands, and to avoid getting out of sync with +previous/future upstart versions. + +This makes reboot/halt work when running upstart with systemd-sysv installed +(on switching to systemd or when booting with init=/sbin/upstart). + +LP: #1370329 +--- + src/systemctl/systemctl.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 42 insertions(+), 2 deletions(-) + +diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c +index 52ca951..8a5b29e 100644 +--- a/src/systemctl/systemctl.c ++++ b/src/systemctl/systemctl.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + + #include "sd-bus.h" +@@ -7337,6 +7338,41 @@ static int talk_initctl(void) { + #endif + } + ++static int talk_upstart(void) { ++ _cleanup_close_ int fd; ++ struct sockaddr_un upstart_addr = { ++ .sun_family = AF_UNIX, ++ .sun_path = "\0/com/ubuntu/upstart\0", ++ }; ++ char rl; ++ char telinit_cmd[] = "telinit X"; ++ ++ /* check if we can connect to upstart; if not, fail */ ++ fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); ++ if (fd < 0) { ++ log_error("socket(AF_UNIX) failed: %m"); ++ return -errno; ++ } ++ if (connect(fd, &upstart_addr, sizeof(upstart_addr.sun_family) + 1 + ++ strlen(upstart_addr.sun_path + 1)) < 0) { ++ log_debug("cannot connect to upstart"); ++ return 0; ++ } ++ log_debug("upstart is running"); ++ ++ rl = action_to_runlevel(); ++ if (!rl) ++ return 0; ++ ++ /* invoke telinit with the desired new runlevel */ ++ telinit_cmd[8] = rl; ++ if (system(telinit_cmd) != 0) { ++ log_error("failed to run %s for upstart fallback", telinit_cmd); ++ return 0; ++ } ++ return 1; ++} ++ + static int systemctl_main(int argc, char *argv[]) { + + static const Verb verbs[] = { +@@ -7432,11 +7468,15 @@ static int start_with_fallback(void) { + if (start_unit(0, NULL, NULL) >= 0) + return 0; + +- /* Nothing else worked, so let's try +- * /dev/initctl */ ++ /* systemd didn't work (most probably it's not the current init ++ * system), so let's try /dev/initctl for SysV init */ + if (talk_initctl() > 0) + return 0; + ++ /* and now upstart */ ++ if (talk_upstart() > 0) ++ return 0; ++ + log_error("Failed to talk to init daemon."); + return -EIO; + } diff -Nru systemd-229/debian/patches/Support-system-image-read-only-etc.patch systemd-229/debian/patches/Support-system-image-read-only-etc.patch --- systemd-229/debian/patches/Support-system-image-read-only-etc.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/patches/Support-system-image-read-only-etc.patch 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1,153 @@ +From: Martin Pitt +Date: Sat, 26 Apr 2014 23:49:32 +0200 +Subject: Support system-image read-only /etc + +On Ubuntu Phone with readonly /etc we symlink +/etc/{adjtime,localtime,timezone,hostname,machine-info} to /etc/writable/, so +we need to update those files instead if the original files are symlinks into +/etc/writable/. + +Forwarded: OMGno, this is a rather nasty hack until we fix system-image to get a writable /etc +Bug-Ubuntu: https://launchpad.net/bugs/1227520 +--- + src/hostname/hostnamed.c | 28 ++++++++++++++++++++++++---- + src/timedate/timedated.c | 31 +++++++++++++++++++++++++------ + 2 files changed, 49 insertions(+), 10 deletions(-) + +diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c +index c37e32e..e3012c5 100644 +--- a/src/hostname/hostnamed.c ++++ b/src/hostname/hostnamed.c +@@ -30,6 +30,7 @@ + #include "hostname-util.h" + #include "parse-util.h" + #include "path-util.h" ++#include "fs-util.h" + #include "selinux-util.h" + #include "strv.h" + #include "user-util.h" +@@ -75,6 +76,25 @@ static void context_free(Context *c) { + bus_verify_polkit_async_registry_free(c->polkit_registry); + } + ++/* Hack for Ubuntu phone: check if path is an existing symlink to ++ * /etc/writable; if it is, update that instead */ ++static const char* writable_filename(const char *path) { ++ ssize_t r; ++ static char realfile_buf[PATH_MAX]; ++ _cleanup_free_ char *realfile = NULL; ++ const char *result = path; ++ int orig_errno = errno; ++ ++ r = readlink_and_make_absolute(path, &realfile); ++ if (r >= 0 && startswith(realfile, "/etc/writable")) { ++ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile); ++ result = realfile_buf; ++ } ++ ++ errno = orig_errno; ++ return result; ++} ++ + static int context_read_data(Context *c) { + int r; + struct utsname u; +@@ -302,12 +322,12 @@ static int context_write_data_static_hostname(Context *c) { + + if (isempty(c->data[PROP_STATIC_HOSTNAME])) { + +- if (unlink("/etc/hostname") < 0) ++ if (unlink(writable_filename("/etc/hostname")) < 0) + return errno == ENOENT ? 0 : -errno; + + return 0; + } +- return write_string_file_atomic_label("/etc/hostname", c->data[PROP_STATIC_HOSTNAME]); ++ return write_string_file_atomic_label(writable_filename("/etc/hostname"), c->data[PROP_STATIC_HOSTNAME]); + } + + static int context_write_data_machine_info(Context *c) { +@@ -353,13 +373,13 @@ static int context_write_data_machine_info(Context *c) { + } + + if (strv_isempty(l)) { +- if (unlink("/etc/machine-info") < 0) ++ if (unlink(writable_filename("/etc/machine-info")) < 0) + return errno == ENOENT ? 0 : -errno; + + return 0; + } + +- return write_env_file_label("/etc/machine-info", l); ++ return write_env_file_label(writable_filename("/etc/machine-info"), l); + } + + static int property_get_icon_name( +diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c +index 0d95316..520cb70 100644 +--- a/src/timedate/timedated.c ++++ b/src/timedate/timedated.c +@@ -83,6 +83,25 @@ static int context_read_data(Context *c) { + return 0; + } + ++/* Hack for Ubuntu phone: check if path is an existing symlink to ++ * /etc/writable; if it is, update that instead */ ++static const char* writable_filename(const char *path) { ++ ssize_t r; ++ static char realfile_buf[PATH_MAX]; ++ _cleanup_free_ char *realfile = NULL; ++ const char *result = path; ++ int orig_errno = errno; ++ ++ r = readlink_and_make_absolute(path, &realfile); ++ if (r >= 0 && startswith(realfile, "/etc/writable")) { ++ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile); ++ result = realfile_buf; ++ } ++ ++ errno = orig_errno; ++ return result; ++} ++ + static int context_write_data_timezone(Context *c) { + _cleanup_free_ char *p = NULL; + int r = 0; +@@ -91,10 +110,10 @@ static int context_write_data_timezone(Context *c) { + assert(c); + + if (isempty(c->zone)) { +- if (unlink("/etc/localtime") < 0 && errno != ENOENT) ++ if (unlink(writable_filename("/etc/localtime")) < 0 && errno != ENOENT) + r = -errno; + +- if (unlink("/etc/timezone") < 0 && errno != ENOENT) ++ if (unlink(writable_filename("/etc/timezone")) < 0 && errno != ENOENT) + r = -errno; + + return r; +@@ -104,12 +123,12 @@ static int context_write_data_timezone(Context *c) { + if (!p) + return log_oom(); + +- r = symlink_atomic(p, "/etc/localtime"); ++ r = symlink_atomic(p, writable_filename("/etc/localtime")); + if (r < 0) + return r; + +- if (stat("/etc/timezone", &st) == 0 && S_ISREG(st.st_mode)) { +- r = write_string_file("/etc/timezone", c->zone, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC); ++ if (stat(writable_filename("/etc/timezone"), &st) == 0 && S_ISREG(st.st_mode)) { ++ r = write_string_file(writable_filename("/etc/timezone"), c->zone, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC); + if (r < 0) + return r; + } +@@ -175,7 +194,7 @@ static int context_write_data_local_rtc(Context *c) { + *(char*) mempcpy(stpcpy(stpcpy(mempcpy(w, s, a), prepend), c->local_rtc ? "LOCAL" : "UTC"), e, b) = 0; + + if (streq(w, NULL_ADJTIME_UTC)) { +- if (unlink("/etc/adjtime") < 0) ++ if (unlink(writable_filename("/etc/adjtime")) < 0) + if (errno != ENOENT) + return -errno; + diff -Nru systemd-229/debian/patches/rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_RULES_.patch systemd-229/debian/patches/rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_RULES_.patch --- systemd-229/debian/patches/rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_RULES_.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/patches/rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_RULES_.patch 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1,30 @@ +From: =?utf-8?q?Luk=C3=A1=C5=A1_Nykr=C3=BDn?= +Date: Tue, 12 Apr 2016 07:44:28 +0200 +Subject: rules: set SYSTEMD_READY=0 on DM_UDEV_DISABLE_OTHER_RULES_FLAG=1 + only with ADD event (#2747) + +The "SYSTEMD_READY=0" will cause automatic unmount +of mountpoint that is on top of such DM device +if this is used with multipath which sets +DM_UDEV_DISABLE_OTHER_RULES_FLAG in case +we have a CHANGE event thatcomes after DM multipath +device reload when one of the paths is down or up. + +See https://bugzilla.redhat.com/show_bug.cgi?id=1312011 +--- + rules/99-systemd.rules.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in +index 5c2cda5..0ac4f6a 100644 +--- a/rules/99-systemd.rules.in ++++ b/rules/99-systemd.rules.in +@@ -11,7 +11,7 @@ SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270 + KERNEL=="vport*", TAG+="systemd" + + SUBSYSTEM=="block", TAG+="systemd" +-SUBSYSTEM=="block", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" ++SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" + + # Ignore encrypted devices with no identified superblock on it, since + # we are probably still calling mke2fs or mkswap on it. diff -Nru systemd-229/debian/patches/series systemd-229/debian/patches/series --- systemd-229/debian/patches/series 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/patches/series 2016-04-12 10:06:37.000000000 +0000 @@ -28,6 +28,8 @@ keymap-Some-HP-refactoring-add-Probook-440-G3-keys.patch man-update-links-to-kernel.org-cgroup-documentation.patch man-fix-cgroup-attributes-for-device-throttling.patch +rules-set-SYSTEMD_READY-0-on-DM_UDEV_DISABLE_OTHER_RULES_.patch +Install-correctly-report-symlink-creations.patch ## Debian specific patches Add-back-support-for-Debian-specific-config-files.patch @@ -60,3 +62,9 @@ Revert-core-one-step-back-again-for-nspawn-we-actual.patch Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch Revert-Revert-networkd-ndisc-revert-to-letting-the-k.patch + +## Ubuntu patches: +Support-system-image-read-only-etc.patch +systemctl-Don-t-forward-telinit-u-to-upstart.patch +Provide-shutdown-fallback-for-upstart.patch +udev-Don-t-kill-peer-processes-if-we-don-t-run-in-a-cgrou.patch diff -Nru systemd-229/debian/patches/systemctl-Don-t-forward-telinit-u-to-upstart.patch systemd-229/debian/patches/systemctl-Don-t-forward-telinit-u-to-upstart.patch --- systemd-229/debian/patches/systemctl-Don-t-forward-telinit-u-to-upstart.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/patches/systemctl-Don-t-forward-telinit-u-to-upstart.patch 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1,36 @@ +From: Martin Pitt +Date: Wed, 11 Mar 2015 10:37:47 +0100 +Subject: systemctl: Don't forward telinit u to upstart + +When dist-upgrading and /sbin/init changes from upstart to systemd, upstart's +Restart() exec's argv[0] which is still /sbin/init, and thus it execs systemd. +This is triggered by glibc upgrades or other things which call "telinit u" in +their postinst scripts. + +This should eventually be fixed in upstart itself, but as we can't +retroactively fix it in previous releases we upgrade from, we simply ignore +the request. + +https://launchpad.net/bugs/1430479 +--- + src/systemctl/systemctl.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c +index 08034eb..52ca951 100644 +--- a/src/systemctl/systemctl.c ++++ b/src/systemctl/systemctl.c +@@ -7255,6 +7255,13 @@ static int parse_argv(int argc, char *argv[]) { + * request to it. For now we simply + * guess that it is Upstart. */ + ++ /* work around upstart exec'ing systemd when /sbin/init ++ * changes (https://launchpad.net/bugs/1430479) */ ++ if (argv[1] != NULL && streq(argv[1], "u")) { ++ log_warning("Ignoring telinit u request, systemd is not running"); ++ return -ENOTSUP; ++ } ++ + execv(TELINIT, argv); + + log_error("Couldn't find an alternative telinit implementation to spawn."); diff -Nru systemd-229/debian/patches/udev-Don-t-kill-peer-processes-if-we-don-t-run-in-a-cgrou.patch systemd-229/debian/patches/udev-Don-t-kill-peer-processes-if-we-don-t-run-in-a-cgrou.patch --- systemd-229/debian/patches/udev-Don-t-kill-peer-processes-if-we-don-t-run-in-a-cgrou.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-229/debian/patches/udev-Don-t-kill-peer-processes-if-we-don-t-run-in-a-cgrou.patch 2016-04-12 10:06:37.000000000 +0000 @@ -0,0 +1,26 @@ +From: Martin Pitt +Date: Thu, 31 Mar 2016 21:47:02 +0200 +Subject: udev: Don't kill peer processes if we don't run in a cgroup + +This happens when running under/upgrading from upstart. udevd and everything +else run in the root hierarchy on all controllers then, and the alleged cleanup +of "our" cgroup becomes a system-wide killing spree. + +Bug-Ubuntu: https://launchpad.net/bugs/1555237 +--- + src/udev/udevd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/udev/udevd.c b/src/udev/udevd.c +index bb92f16..a1396f1 100644 +--- a/src/udev/udevd.c ++++ b/src/udev/udevd.c +@@ -1254,7 +1254,7 @@ static int on_post(sd_event_source *s, void *userdata) { + r = sd_event_exit(manager->event, 0); + if (r < 0) + return r; +- } else if (manager->cgroup) ++ } else if (manager->cgroup && !streq(manager->cgroup, "/")) + /* cleanup possible left-over processes in our cgroup */ + cg_kill(SYSTEMD_CGROUP_CONTROLLER, manager->cgroup, SIGKILL, false, true, NULL); + } diff -Nru systemd-229/debian/systemd.postinst systemd-229/debian/systemd.postinst --- systemd-229/debian/systemd.postinst 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/systemd.postinst 2016-04-12 10:06:37.000000000 +0000 @@ -42,7 +42,7 @@ fi # Do a one-time migration of the local time setting -if dpkg --compare-versions "$2" lt "33-1"; then +if dpkg --compare-versions "$2" lt "228-5ubuntu3"; then if [ -f /etc/default/rcS ]; then . /etc/default/rcS fi @@ -154,4 +154,19 @@ _systemctl start systemd-networkd-resolvconf-update.path || true fi +# migrate mountall specific fstab options to standard util-linux "nofail" option +if dpkg --compare-versions "$2" lt "221-1" && [ -w /etc/fstab ]; then + if awk '{ gsub(/^nobootwait/, "nofail", $4); gsub(/,nobootwait/, ",nofail", $4); gsub(/^optional/, "nofail", $4); gsub(/,optional/, ",nofail", $4); print }' /etc/fstab > /etc/fstab.new; then + if cmp --quiet /etc/fstab /etc/fstab.new; then + rm /etc/fstab.new # nothing to migrate + else + echo "Replacing obsolete mountall options in /etc/fstab... (backup in /etc/fstab.mountall)" + mv /etc/fstab /etc/fstab.mountall + mv /etc/fstab.new /etc/fstab + fi + else + echo "WARNING! Could not create /etc/fstab.new for migrating obsolete mountall options" >&2 + fi +fi + #DEBHELPER# diff -Nru systemd-229/debian/tests/cmdline-upstart-boot systemd-229/debian/tests/cmdline-upstart-boot --- systemd-229/debian/tests/cmdline-upstart-boot 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/tests/cmdline-upstart-boot 2016-04-12 10:06:37.000000000 +0000 @@ -49,7 +49,7 @@ # has kernel messages self.assertRegex(log, 'kernel:.*[cC]ommand line:') # has other services - self.assertRegex(log, 'NetworkManager.*:') + self.assertRegex(log, 'dbus.*:') def test_udev(self): out = subprocess.check_output(['udevadm', 'info', '--export-db']) diff -Nru systemd-229/debian/tests/unit-config systemd-229/debian/tests/unit-config --- systemd-229/debian/tests/unit-config 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/tests/unit-config 2016-04-12 10:06:37.000000000 +0000 @@ -10,22 +10,30 @@ import tempfile from glob import glob +if os.path.isdir('/usr/lib/systemd/system'): + system_unit_dir = '/usr/lib/systemd/system' +else: + system_unit_dir = '/lib/systemd/system' +systemd_sysv_install = os.path.join(os.path.dirname(system_unit_dir), + 'systemd-sysv-install') + class EnableTests(unittest.TestCase): def tearDown(self): # remove all traces from our test unit - f = glob('/lib/systemd/system/test_enable*.service') - f += glob('/lib/systemd/system/*/test_enable*.service') + f = glob(system_unit_dir + '/test_enable*.service') + f += glob(system_unit_dir + '/*/test_enable*.service') f += glob('/etc/systemd/system/test_enable*.service') f += glob('/etc/systemd/system/*/test_enable*.service') f += glob('/etc/init.d/test_enable*') f += glob('/etc/rc?.d/???test_enable*') [os.unlink(i) for i in f] + subprocess.check_call(['systemctl', 'daemon-reload']) - def create_unit(self, suffix='', dir='/lib', enable=False): + def create_unit(self, suffix='', enable=False): '''Create a test unit''' - unit = os.path.join(dir, 'systemd', 'system', + unit = os.path.join(system_unit_dir, 'test_enable%s.service' % suffix) with open(unit, 'w') as f: f.write('''[Unit] @@ -62,10 +70,8 @@ os.chmod(script, 0o755) if enable: - subprocess.check_call(['update-rc.d', os.path.basename(script), - 'defaults']) - subprocess.check_call(['update-rc.d', os.path.basename(script), - 'enable']) + subprocess.check_call( + [systemd_sysv_install, 'enable', os.path.basename(script)]) def assertEnabled(self, enabled, unit='test_enable.service'): '''assert that given unit has expected state''' @@ -98,7 +104,11 @@ l = '/etc/systemd/system/multi-user.target.wants/test_enable.service' self.assertTrue(os.path.islink(l)) self.assertEqual(os.readlink(l), - '/lib/systemd/system/test_enable.service') + system_unit_dir + '/test_enable.service') + + # enable should be idempotent + subprocess.check_call(['systemctl', 'enable', 'test_enable.service']) + self.assertEnabled(True) def test_unit_disable(self): '''no sysv: disable unit''' @@ -117,6 +127,10 @@ l = '/etc/systemd/system/multi-user.target.wants/test_enable.service' self.assertFalse(os.path.islink(l)) + # disable should be idempotent + subprocess.check_call(['systemctl', 'disable', 'test_enable.service']) + self.assertEnabled(False) + def test_unit_sysv_enable(self): '''with sysv: enable unit''' @@ -135,13 +149,17 @@ l = '/etc/systemd/system/multi-user.target.wants/test_enable.service' self.assertTrue(os.path.islink(l)) self.assertEqual(os.readlink(l), - '/lib/systemd/system/test_enable.service') + system_unit_dir + '/test_enable.service') # enabled the sysv script l = glob('/etc/rc2.d/S??test_enable') self.assertEqual(len(l), 1, 'expect one symlink in %s' % repr(l)) self.assertEqual(os.readlink(l[0]), '../init.d/test_enable') + # enable should be idempotent + subprocess.check_call(['systemctl', 'enable', 'test_enable.service']) + self.assertEnabled(True) + def test_unit_sysv_disable(self): '''with sysv: disable unit''' @@ -164,6 +182,10 @@ l = glob('/etc/rc2.d/S??test_enable') self.assertEqual(l, []) + # disable should be idempotent + subprocess.check_call(['systemctl', 'enable', 'test_enable.service']) + self.assertEnabled(True) + def test_unit_alias_enable(self): '''no sysv: enable unit with an alias''' @@ -181,13 +203,13 @@ l = '/etc/systemd/system/multi-user.target.wants/test_enable.service' self.assertTrue(os.path.islink(l)) self.assertEqual(os.readlink(l), - '/lib/systemd/system/test_enable.service') + system_unit_dir + '/test_enable.service') # alias symlink l = '/etc/systemd/system/test_enablea.service' self.assertTrue(os.path.islink(l)) self.assertEqual(os.readlink(l), - '/lib/systemd/system/test_enable.service') + system_unit_dir + '/test_enable.service') def test_unit_alias_disable(self): '''no sysv: disable unit with an alias''' @@ -195,7 +217,7 @@ u = self.create_unit() with open(u, 'a') as f: f.write('Alias=test_enablea.service\n') - os.symlink('/lib/systemd/system/test_enable.service', + os.symlink(system_unit_dir + '/test_enable.service', '/etc/systemd/system/test_enablea.service') subprocess.check_call(['systemctl', 'disable', 'test_enable']) @@ -226,13 +248,13 @@ l = '/etc/systemd/system/multi-user.target.wants/test_enable.service' self.assertTrue(os.path.islink(l)) self.assertEqual(os.readlink(l), - '/lib/systemd/system/test_enable.service') + system_unit_dir + '/test_enable.service') # alias symlink l = '/etc/systemd/system/test_enablea.service' self.assertTrue(os.path.islink(l)) self.assertEqual(os.readlink(l), - '/lib/systemd/system/test_enable.service') + system_unit_dir + '/test_enable.service') # enabled the sysv script l = glob('/etc/rc2.d/S??test_enable') @@ -247,7 +269,7 @@ u = self.create_unit(enable=True) with open(u, 'a') as f: f.write('Alias=test_enablea.service\n') - os.symlink('/lib/systemd/system/test_enable.service', + os.symlink(system_unit_dir + '/test_enable.service', '/etc/systemd/system/test_enablea.service') self.create_sysv(enable=True) @@ -278,6 +300,10 @@ self.assertEqual(len(l), 1, 'expect one symlink in %s' % repr(l)) self.assertEqual(os.readlink(l[0]), '../init.d/test_enable') + # enable should be idempotent + subprocess.check_call(['systemctl', 'enable', 'test_enable']) + self.assertEnabled(True) + def test_sysv_disable(self): '''only sysv: disable''' @@ -288,6 +314,10 @@ l = glob('/etc/rc2.d/S??test_enable') self.assertEqual(l, []) + # disable should be idempotent + subprocess.check_call(['systemctl', 'disable', 'test_enable']) + self.assertEnabled(False) + def test_unit_link(self): '''systemctl link''' @@ -296,9 +326,43 @@ f.flush() subprocess.check_call(['systemctl', 'link', f.name]) - l = os.path.join('/etc/systemd/system', os.path.basename(f.name)) + unit = os.path.basename(f.name) + l = os.path.join('/etc/systemd/system', unit) + self.assertEqual(os.readlink(l), f.name) + + # disable it again + subprocess.check_call(['systemctl', 'disable', unit]) + # this should also remove the unit symlink + self.assertFalse(os.path.islink(l)) + + def test_unit_enable_full_path(self): + '''systemctl enable a unit in a non-default path''' + + with tempfile.NamedTemporaryFile(suffix='.service') as f: + f.write(b'''[Unit] +Description=test +[Service] +ExecStart=/bin/true +[Install] +WantedBy=multi-user.target''') + f.flush() + unit = os.path.basename(f.name) + + # now enable it + subprocess.check_call(['systemctl', 'enable', f.name]) + self.assertEnabled(True, unit=unit) + l = os.path.join('/etc/systemd/system', unit) self.assertEqual(os.readlink(l), f.name) - os.unlink(l) + enable_l = '/etc/systemd/system/multi-user.target.wants/' + unit + self.assertEqual(os.readlink(enable_l), f.name) + + # disable it again + subprocess.check_call(['systemctl', 'disable', unit]) + # self.assertEnabled(False) does not work as now systemd does not + # know about the unit at all any more + self.assertFalse(os.path.islink(enable_l)) + # this should also remove the unit symlink + self.assertFalse(os.path.islink(l)) if __name__ == '__main__': diff -Nru systemd-229/debian/udev-udeb.install systemd-229/debian/udev-udeb.install --- systemd-229/debian/udev-udeb.install 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/udev-udeb.install 2016-04-12 10:06:37.000000000 +0000 @@ -15,5 +15,5 @@ lib/udev/rules.d/80-net-setup-link.rules ../../extra/90-mac-for-usb.link lib/systemd/network/ ../../extra/rules/50-firmware.rules lib/udev/rules.d/ -../../extra/rules/73-idrac.rules lib/udev/rules.d/ +../../extra/rules/73-special-net-names.rules lib/udev/rules.d/ ../../extra/start-udev lib/debian-installer/ diff -Nru systemd-229/debian/udev.maintscript systemd-229/debian/udev.maintscript --- systemd-229/debian/udev.maintscript 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/udev.maintscript 2016-04-12 10:06:37.000000000 +0000 @@ -4,3 +4,5 @@ rm_conffile /etc/init/udev-finish.conf 226-1~ rm_conffile /etc/init/udev-fallback-graphics.conf 226-1~ symlink_to_dir /usr/share/doc/udev libudev1 221-2~ +rm_conffile /etc/udev/rules.d/README 215-5ubuntu1~ +rm_conffile /etc/init.d/lvm2 228-2ubuntu2~ diff -Nru systemd-229/debian/udev.postinst systemd-229/debian/udev.postinst --- systemd-229/debian/udev.postinst 2016-04-07 06:11:16.000000000 +0000 +++ systemd-229/debian/udev.postinst 2016-04-12 10:06:37.000000000 +0000 @@ -88,6 +88,35 @@ NamePolicy=onboard kernel EOF fi + + # this is being written under upstart, but not under systemd; clean up + # obsolete files + if [ -d /run/systemd/system ]; then + rm -f /var/log/udev + fi + + # transition existing interface names on s390x for #1526808 + if dpkg --compare-versions "$2" lt-nl "228-4ubuntu2" && + [ "$(dpkg --print-architecture)" = "s390x" ]; then + sed 's/enccw[0.]*/enc/' -i /etc/network/interfaces /etc/network/interfaces.d/* 2>/dev/null || true + fi + + # VMWare BIOS reports implausibly high onboard numbers, this got fixed in + # https://github.com/systemd/systemd/commit/6c1e69f9; migrate names in + # ifupdown accordingly + if dpkg --compare-versions "$2" lt-nl "229-2ubuntu2"; then + for i in /sys/class/net/eno*; do + if [ "${i#*/eno}" -gt 16383 ] 2>/dev/null; then + if slotname=$(udevadm info --query=property $i | grep '^ID_NET_NAME_SLOT='); then + slotname=${slotname#*=} + echo "Migrating broken onboard-based network interface name ${i##*/} to slot-based name $slotname in /etc/network/interfaces and interfaces.d/..." + sed -i "s/\\b${i##*/}\\b/$slotname/g" /etc/network/interfaces /etc/network/interfaces.d/* 2>/dev/null || true + else + echo "WARNING: Cannot determine proper name for broken onboard-based network interface name ${i##*/}; you must adjust /etc/network/interfaces and interfaces.d/ manually" + fi + fi + done + fi } update_hwdb() {