Commit Graph

184 Commits

Author SHA1 Message Date
Martin Pitt
c41ccefca5 Add debian/extra/kernel-install.d/60-initrd.install
This kernel-install drop-in copies the initrd of the selected kernel to the
EFI partition.
2016-08-24 06:54:17 +02:00
Martin Pitt
b42e1f8af2 73-usb-net-by-mac.rules: Test for disabling 80-net-setup-link.rules more efficiently
Do not run readlink for *every* uevent, this should (at most) be done for USB
network devices, so move that test after that.

Also, stop calling readlink at all and just test if
/etc/udev/rules.d/80-net-setup-link.rules exists -- a common way to disable an
udev rule is to just "touch" it in /etc/udev/rule.d/ (i. e. empty file), and if
the rule is customized we cannot really predict anyway if the user wants
MAC-based USB net names or not.

LP: #1615021
2016-08-24 06:41:11 +02:00
Martin Pitt
9d39d5c127 resolved resolvconf integration: Run resolvconf without privilege restrictions
On some architectures (at least ppc64el), running resolvconf does not work with
MemoryDenyWriteExecute=yes:

    Process: 4728 ExecStartPost=/bin/sh -c [ ! -e /run/resolvconf/enable-updates ] || echo "nameserver 127.0.0.53" | /sbin/resolvconf -a systemd-resolved (code=exited, status=127)

    Aug 15 07:16:39 autopkgtest sh[4659]: sed: error while loading shared libraries: cannot restore segment prot after reloc: Operation not permitted

LP: #1609740
2016-08-15 09:26:15 +02:00
Martin Pitt
05199cdc74 Replace debian/extra/user-units/graphical-session-pre.target with upstream patch
Gbp-Dch: Ignore
2016-08-02 16:38:11 +02:00
Martin Pitt
106676a209 Add debian/extra/units-ubuntu/user@.service.d/timeout.conf
This avoids long hangs during shutdown if user services fail/hang due to X.org
going away too early. This is mostly a workaround, so only install for
Ubuntu for now.
2016-07-26 10:39:22 +02:00
Martin Pitt
cf8239f7b3 Add graphical-session-pre.target user unit
We need an "early" session target for things like gnome-keyring, openssh's
ssh-agent, session-migration etc. which all need to start before the main
desktop. These export environment variables to systemd/D-Bus such as
SSH_AUTH_SOCK or update the gsettings database.

This will be upstreamed soon once the structure for graphical systemd sessions
settles down.

Gbp-Dch: Short
2016-07-26 09:33:32 +02:00
Michael Biebl
76f105d6f2 Drop sigpwr-container-shutdown.service
This is no longer necessary as lxc-stop has been fixed to use SIGRTMIN+3
to shut down systemd based LXC containers.

https://github.com/lxc/lxc/pull/1086
https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
2016-07-20 16:31:09 +02:00
Michael Biebl
89b4cb17a3 getty-static.service: Only start if we have a working VC subsystem
Use ConditionPathExists=/dev/tty0, the same check as in getty@.service,
to determine whether we have a functional VC subsystem and we should
start any gettys.

Closes: #824779
2016-07-20 16:30:59 +02:00
Martin Pitt
93e26ec832 debian/extra/rules/73-usb-net-by-mac.rules: Disable when /etc/udev/rules.d/80-net-setup-link.rules is a symlink to /dev/null
To be consistent with the documented way to disable ifnames.

Closes: #824491
LP: #1593379
2016-06-30 13:07:11 +02:00
Martin Pitt
0345d09eb9 Add resolved → resolvconf integration
Add debian/extra/units/systemd-resolved.service.d/resolvconf.conf to tell
resolvconf about resolved's builtin DNS server on 127.0.0.53. With that, DNS
servers picked up via networkd are respected when using resolvconf, and
software like Chrome that does not do NSS (libnss-resolve) still gets proper
DNS resolution.

Drop the brittle and ugly systemd-networkd-resolvconf-update.{path,service}
hack instead.
2016-06-29 15:22:52 +02:00
Martin Pitt
fd907eeaee debian/extra/init-functions.d/40-systemd: Do not call systemctl daemon-reload if the script is called as user
reportbug currently does that to determine $is_upstart.

Also make sure that daemon-reload will not invoke polkit.
2016-06-14 10:45:21 +03:00
Martin Pitt
2558ca883b On Ubuntu, provide an "ondemand.service" that replaces /etc/init.d/ondemand
The latter does not exist any more when "initscripts" falls out of the default
installation. This now does not do a fixed one-minute wait but uses "Type=idle"
instead. This also becomes a no-op when the CPU supports "intel_pstate" (≤ 5
years old), as on these the ondemand/powersave schedulers are actually
detrimental.

LP: #1584124
LP: #1579278
2016-06-08 11:16:12 +02:00
Martin Pitt
f1c7ded77d Fix networkd integration with resolvconf for domain-limited DNS servers
DNS servers which only apply to particular domains should/must not appear in
/etc/resolv.conf as globl name servers.

Thanks Andy Whitcroft for the initial fix!

Add corresponding test case to debian/tests/networkd.

LP: #1587762
2016-06-02 11:16:31 +02:00
Martin Pitt
daf04880af debian/extra/init-functions.d/40-systemd: Adjust to changed systemctl show behaviour in 231
Since upstream commit e33a06a1 "systemctl show" fails for nonexisting units
instead of succeeding with "not-found". Make the code compatible to both for
now.
2016-06-01 23:05:54 +02:00
Michael Biebl
c4a61a3cec Add "systemctl daemon-reload" to lsb init-functions hook if the LoadState of a service is "not-found"
This will run systemd-sysv-generator, so SysV init scripts that aren't
installed by the package manager should be picked up automatically.

Closes: #825913
2016-05-31 17:20:06 +02:00
Michael Biebl
d698fd4ceb Use systemctl's new --value switch
to get the CanReload and LoadState property directly.
2016-05-31 17:06:11 +02:00
Martin Pitt
b9824a6c0f debian/extra/rules/70-debian-uaccess.rules: Add some more FIDO u2f devices from different vendors
Thanks Atoyama Tokanawa.

(See LP: #1387908)
2016-05-17 07:44:54 +02:00
Martin Pitt
7c43fa2dcc udev: Drop hotplug.functions
The last remaining user of this (ifplugd) got fixed.

Add appropriate versioned Breaks: to ensure that older versions of these three
packages are not being used with this new udev.
2016-05-13 14:44:31 +02:00
Martin Pitt
845af7b797 73-special-net-names.rule: Name the IBM integrated management module virtual USB network card "ibmimm"
Thanks Marco d'Itri!
2016-05-11 23:10:37 +02:00
Martin Pitt
b3e7c6ee79 73-usb-net-by-mac.rules: Disable when net.ifnames=0 is specified on the kernel command line
To be consistent with disabling the *.link files.
2016-05-11 23:07:10 +02:00
Martin Pitt
b72e3d3b27 Split out udev rule to name USB network interfaces by MAC address into 73-usb-net-by-mac.rules
With that it is easier to disable.

Closes: #824025
2016-05-11 22:48:37 +02:00
Martin Pitt
77d020de95 Add a DHCP exit hook for pushing received NTP servers into timesyncd
LP: #1578663
2016-05-05 11:02:26 -05:00
Martin Pitt
09b5bcb064 Make FIDO U2F dongles accessible to the user session
This avoids having to install libu2f-host0 (which isn't discoverable at all) to
make those devices work.

Add this to debian/extra/rules/70-debian-uaccess.rules, as we might get similar
rules in the future. This was rejected upstream at
https://github.com/systemd/systemd/issues/102 because in some future this
should move to a proper kernel driver. Keep this downstream until that happens
and Chrome & friends move over to that.

LP: #1387908
2016-05-02 14:48:13 -05:00
Martin Pitt
e308302dc0 debian/extra/init-functions.d/40-systemd: Invoke status command with --no-pager
This avoids blocking scripts that call an init.d script with "status" with an
unexpected pager process.

Closes: #765175
LP: #1576409
2016-04-28 22:53:03 +02:00
Martin Pitt
efbe5b3e93 Set MAC based name for USB network interfaces only for universally administered (i. e. stable) MACs
Stop doing this for locally administered (i. e. randomly generated) ones. These
devices have no intrinsic stable properties, so use the default location based
names for those.

Drop /lib/systemd/network/90-mac-for-usb.link (as link files don't currently
support globs for MACAddress=) and replace with an udev rule in
/lib/udev/rules.d/73-special-net-names.rules.

Closes: #812575
LP: #1574483
2016-04-25 10:32:20 +02:00
Martin Pitt
8b023317c1 73-special-net-names.rules: Further refine ibmveth naming
Don't greedily chop off everything before a 0, as that breaks with vio
addresses like "30001002". Instead, just chop off the first four digits (bus
number) and chop off leading zeros (avoids calling sed or other external
programs, and there are at most four of them).
2016-04-12 12:01:59 +02:00
Martin Pitt
3dee9daaf6 73-special-net-names.rules: Refine ibmveth naming
Stop assuming that the bus number always starts with '3', e. g. QEMU defaults
to '7'. Instead, now always just cut off the bus number prefix.  This assumes
that we won't get *two* virtual buses with conflicting device numbers, but
having multiple buses has never been observed.

If a device has number 'x000000', name it "ibmveth0" instead of just "ibmveth".

Add missing ' to terminate the sh -c '' command.

Thanks to Adam Conrad!
2016-04-12 10:32:33 +02:00
Martin Pitt
e9b0aa0f25 debian/extra/rules/73-special-net-names.rules: Add DEVPATH number based naming schema for ibmveth devices
ibmveth devices' $DEVPATH number usually starts with '3' and is tied to
(virtual) hardware (slot id selected in the HMC), thus this provides a reliable
naming. E. g. "/devices/vio/30000002/net/eth1" gets named "ibmveth2".

LP: #1561096
2016-04-11 23:51:56 +02:00
Martin Pitt
4bd57cb812 Rename debian/extra/rules/73-idrac.rules to 73-special-net-names.rules
It is going to get rules for other devices. Also install it into the initramfs.
2016-04-11 23:30:40 +02:00
Martin Pitt
dc5da62e93 debian/extra/checkout-upstream: Try again after one minute if git checkout fails
This should avoid failures from transient network errors, like in

  https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-xenial-pitti-systemd-semaphore/xenial/amd64/s/systemd-upstream/20160218_135146@/log.gz
2016-02-18 15:39:07 +01:00
Martin Pitt
c7d36e4e6d Revert "checkout-upstream: shallow cloning"
This reverts commit 8d6e1b9981.
That broke "git describe".
2016-02-10 18:20:41 +01:00
Martin Pitt
8d6e1b9981 checkout-upstream: shallow cloning
We don't need the entire history, so clone/fetch with --depth=1.
2016-02-10 17:27:58 +01:00
Martin Pitt
dbb315b949 Add debian/extra/checkout-upstream
This is a script to replace the current source with a checkout of an upstream
pull request, branch, or commit, and remove debian/patches/. This also disables
autopkgtests which are not appropriate for testing upstream. Called from
debian/rules if $TEST_UPSTREAM is set.

This will be used for upstream CI.
2016-02-10 13:06:52 +01:00
Michael Biebl
36648cdcc7 Drop "systemctl daemon-reload" from lsb init-functions hook
This is no longer necessary as invoke-rc.d and init-system-helpers take
care of this nowadays.
2016-02-03 04:17:19 +01:00
Martin Pitt
2f82b5c251 systemd-timesyncd.service: Also don't run if /usr/sbin/VBoxService exists
virtualbox-guest-utils already provides time synchronization with the host.

Closes: #812522
2016-01-24 19:32:57 +01:00
Martin Pitt
2a2e638e94 debian/extra/initramfs-tools/scripts/init-bottom/udev: Prefer "nuke" again
This command comes from klibc-utils, not from initramfs-tools. But fall back to
"rm" if it does not exist.
2016-01-21 09:53:13 +01:00
Martin Pitt
d94cda1921 Drop systemd-vconsole-setup.service
It has never been installed/used in Debian and is not necessary for Ubuntu any
more.
2016-01-11 14:00:47 +01:00
Martin Pitt
e81ab56310 Put back /lib/udev/hotplug.functions
Until the three remaining packages that use it stop doing so:

  - usb-modeswitch: https://bugs.debian.org/810104
  - joystick: https://bugs.debian.org/810115
  - ifplugd: https://bugs.debian.org/810116

Closes: #810114
2016-01-06 17:36:31 +01:00
Martin Pitt
ce90464a93 Drop net.agent, 80-networking.rules, and ifup@.service
These moved to ifupdown 0.8.5 now. Add Breaks: to earlier versions.
2016-01-02 10:03:56 +01:00
Andreas Henriksson
92c9b709a4 /lib/lsb/init-functions.d/40-systemd: don't reload masked services
When a service is masked the native service does not support
reload, so the lsb hooks would then allow fallback on init script
reload function.

Move the check for masked services earlier and bail out with exit 0
so that does not happen.

(Still a bit confusing that there's no output at all to inform
the user calling the init script for a masked service about this,
but I've been told it's on purpose eg. to avoid spamming the logs.)

Closes: #804882
2015-12-31 17:31:24 +01:00
Martin Pitt
018671ca10 Eliminate "hotplug.functions" udev helper and put the logging functions directly into net.agent
This simplifies the migration of net.agent to ifupdown.
2015-12-27 20:15:54 +01:00
Martin Pitt
792d45a0a0 Fix CD/DVD symlinks
debian/extra/rules/80-debian-compat.rules: Remember which device got the
"cdrw", "dvd", or "dvdrw" symlink to avoid changing links on device events.

Drop the rule for the "cdrom" symlink as that is already created in
60-cdrom_id.rules.

Closes: #774080
2015-12-27 19:43:21 +01:00
Michael Biebl
4be0de292e Drop networking.service.d/systemd.conf
The ifupdown package now ships a proper service file so this drop-in
file is no longer necessary.
2015-12-21 12:52:58 +01:00
Martin Pitt
d77cf3ba3f debian/extra/initramfs-tools/scripts/init-bottom/udev: Use "rm -rf" instead of "nuke"
"nuke" does not exist any more in current initramfs-tools.
2015-12-10 13:16:22 +01:00
Martin Pitt
8c46706158 systemd-networkd-resolvconf-update.service: Wait for getting a name server, not just for getting online
This was a race condition which sometimes led to resolvconf not knowing about
the received name server. This now also ensures to update resolvconf if the
name server goes away.
2015-11-23 08:38:33 +01:00
Michael Biebl
9d05db806a Drop systemd-setup-dgram-qlen.service
This has been made obsolete by upstream commit 1985486 which bumps
net.unix.max_dgram_qlen to 512 early during boot.
2015-11-18 15:33:40 +01:00
Michael Biebl
f80ffd240e Fix StartLimitBurst in systemd-networkd-resolvconf-update.service
DefaultStartLimitBurst can only be set system wide in system.conf. In a
service unit we need to use StartLimitBurst instead.
2015-11-14 15:32:03 +01:00
Martin Pitt
191d4e8ddb systemd-networkd-resolvconf-update.service: Increase StartLimitBurst
This might be legitimately called several times in quick succession.

If that part of the "networkd" autopkgtest fails, show the journal log for that
service for easier debugging.
2015-11-13 08:43:45 +01:00
Martin Pitt
b3ba0e6014 Drop debian-fixup.service in favor of using a tmpfiles.d clause
This is faster, and more aligned to what upstream does. We currently don't
install tmpfiles.d/etc.conf, so copy the rule to debian.conf for now.
2015-10-27 12:07:35 +01:00
Martin Pitt
7b9a61f102 ifup@.service: Drop PartOf=network.target
We don't want to stop these units during shutdown. Stopping networking.service
already shuts down the interfaces, but contains the safeguard for NFS or other
network file systems. Isolating emergency.target still keeps working as before
as well, as this also stops networking.service.

Closes: #761909
LP: #1492546
2015-10-05 12:50:57 +02:00