Commit Graph

45 Commits

Author SHA1 Message Date
Matthias Klumpp
63f22a7a8d Configure localed to run locale-gen to generate missing locale
This applies an (upstreamed) patch to permit systemd-localed to run
locale-gen to generate missing locale when requested to switch the
system locale.
This makes localectl usable on Debian for changing locale without
breaking system localization or even prevent certain applications from
running at all after switching to a non-generated locale.
2021-01-18 03:05:05 +01:00
Michael Biebl
ec74429dbe getty-static.service: Skip if dbus-broker is installed
Check for the binary in /usr/bin as this makes it easier to move the
service files from /lib/systemd to /usr/lib/systemd.
2020-12-26 13:33:06 +01:00
Michael Biebl
8c0b1a1856 init-functions, getty-static.service: Don't hard-code path to systemctl binary
This should simplify an eventual move of systemctl from /bin to
/usr/bin.
2020-12-26 13:24:58 +01:00
Michael Biebl
a318f0220d Remove resolvconf.conf drop-in, resolved integration moved to resolvconf package 2020-08-17 12:54:55 +02:00
Topi Miettinen
32c0a18d2b
Delete empty lines at end of file
Upstream commit hooks don't allow empty lines and of course they serve no
purpose.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-05-16 11:25:10 +03:00
Balint Reczey
d6483013d5 Ship systemd-timesyncd in a separate package
The new systemd-timesyncd package conflicting with other NTP-related
packages resolves the problems arising when installing systemd-timesyncd
and other NTP servers on the same system.

Co-authored-by: Michael Biebl <biebl@debian.org>
LP: #1849156
Closes: #805927, #947936
2020-04-02 16:36:09 +02:00
Michael Biebl
e1b3868e8b Revert "Drop systemd-timesyncd.service.d/disable-with-time-daemon.conf"
Apparently Conflicts= are not a reliable mechanism to ensure alternative
NTP implementations take precedence over systemd-timesyncd.

This reverts commit b2ced99893.

Closes: #902026
2019-03-31 19:37:41 +00:00
Michael Biebl
b2ced99893 Drop systemd-timesyncd.service.d/disable-with-time-daemon.conf
All major NTP implementations ship a native service file nowadays with a
Conflicts=systemd-timesyncd.service so this drop-in is no longer
necessary.

Closes: #873185
2017-09-04 00:15:01 +02:00
Martin Pitt
030866cf7d systemd-resolved.service.d/resolvconf.conf: Don't fail if resolvconf is not installed
ReadWritePaths= fails by default if the referenced directory does not
exist. This happens if resolvconf is not installed, so use '-' to ignore
the absence.

Closes: #854814
2017-02-11 17:12:40 +01:00
Martin Pitt
b487b18359 systemd-resolved.service.d/resolvconf.conf: Allow writing to /run/resolvconf
https://github.com/systemd/systemd/pull/5283 will introduce permission
restrictions for systemd-resolved.service, including the lockdown to
writing /run/systemd/. This will then cause the resolvconf call in our
drop-in to fail as that needs to write to /run/resolvconf/. Add this to
ReadWritePaths=. (This is a no-op with the current unrestricted unit).
2017-02-09 22:05:47 +01:00
Martin Pitt
dbda116b25 resolved: Drop removal of resolvconf entry on stop
This leads to timeouts on shutdown via the resolvconf hooks and does not
actually help much -- /etc/resolv.conf would then just be empty instead of
having a nonexisting 127.0.0.53 nameserver, so manually stopping resolved in a
running system is broken either way.

LP: #1648068
2016-12-12 13:26:46 +01: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
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
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
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
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
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
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
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
Martin Pitt
b1c7fd6cce Add systemd-networkd-resolvconf-update.{path,service} units
These send DNS server updates from networkd to resolvconf, if installed and
enabled. As we removed if-up.d/ integration, resolvconf is not otherwise being
updated.

Adjust the test suite as the previous commit stopped waiting for if-up.d/ to
have run, so now we need to wait for resolvconf to finish.
2015-09-30 12:15:40 +02:00
Martin Pitt
b2b6f2951e Rework networkd ifupdown integration
Drop networkd-if-up.d@.service and its invocation from net.agent again. It does
not work when restarting networkd and requires too much overhead.

Instead, add a suid root helper systemd-networkd-dispatcher which calls
run-parts, and patch networkd to run the wrapper at the appropriate time.

Add reference to LP: #1492129.
2015-09-09 10:46:46 +02:00
Martin Pitt
02b2eb8cdd Simplify debian-fixup.service
debian-fixup.service just has one purpose now (make /etc/mtab a symlink), so
drop the debian/extra/debian-fixup shell script and put the ln command directly
into debian-fixup.service. Update the description.
2015-09-09 08:30:48 +02:00
Martin Pitt
27f7cc9f9f Make networkd call if-up.d/ scripts when it brings up interfaces
With this, networkd becomes compatible with ifupdown and NetworkManager for
packages shipping hooks.

 - Add debian/extra/units/networkd-if-up.d@.service: Wait for a particular
   interface to be up, and call if-up.d/ for it if it is managed by
   networkd. Correspondingly, call if-post-down.d/ scripts when stopping.
 - debian/extra/udev-helpers/net.agent: Start/stop
   networkd-if-up.d@.service when interfaces appear/go away.
 - debian/tests/networkd: Verify that if-up.d/ and if-post-down.d/ scripts
   get run for a networkd managed interface.

Note that if-pre-up.d/ and if-down.d/ scripts are *not* being called + (like
NetworkManager), as they are unnecessary (if-pre-up.d) and unreliable
(if-down.d).

See Ubuntu blueprint for details:
https://blueprints.launchpad.net/ubuntu/+spec/foundations-w-networkd-vs-ifupdown
2015-09-03 16:18:05 +02:00
Martin Pitt
96348b338f ifup@.service: Fix ifquery call after dropping Type=oneshot
Follow-up fix for commit 7f563b59e: With Type=simple, ExecStartPost runs
immediately after ifup got started, not after it finished. So we can't use
ExecStartPost here, but instead run both "ifup" and "ifquery" in the same
ExecStart command.
2015-07-29 23:53:14 +02:00
Martin Pitt
7f563b59ef ifup@.service: Drop "oneshot" to run ifup in the background during boot
This avoids blocking network.target on boot with unavailable hotplug interfaces
in /etc/network/interfaces. The main purpose of the Before=network.target is to
ensure a robust shutdown order, not to block the boot on ifup'ing every
interface; services which want that need to depend on network-online.target.

Closes: #790669
LP: #1425376
2015-07-27 07:03:46 +02:00
Martin Pitt
7cdf9f651a Have rc-local.service output also go to the console
/etc/rc.local often contains status messages which users expect to see during boot.

Rename debian/extra/units/rc-local.service.d/wait-online.conf to debian.conf
and add the Standard{Output,Error} settings there.

LP: #1468102
2015-06-26 15:08:36 +02:00
Martin Pitt
4a26840495 Make rc-local.service wait for network-online.target (if it gets started)
Add debian/extra/units/rc-local.service.d/wait-online.conf.
This not specified by LSB, but has been behaving that way in Debian under SysV
init and upstart.

LP: #1451797
2015-06-01 15:56:48 +02:00
Michael Biebl
ff10f7e194 Put back Before=sysinit.target ordering in debian-fixup.service
This was accidentally dropped in f832a9c. We don't want late boot
services looking at a bad /etc/mtab.
2015-05-29 07:40:21 +02:00
Michael Biebl
f832a9ce7b Remove /var/run and /var/lock migration code from debian-fixup
The /run migration was completed in wheezy so this is no longer
necessary.
2015-05-29 07:24:36 +02:00
Martin Pitt
44c3369f97 Add sigpwr-container-shutdown.service: Power off when receiving SIGPWR in a container
This makes lxc-stop work for systemd containers.

https://lists.linuxcontainers.org/pipermail/lxc-users/2015-May/009279.html

LP: #1457321
2015-05-21 08:11:18 +02:00
Martin Pitt
7f374c476f Make apparmor run before networking
To ensure that profiles apply to e. g. dhclient:

 - Rename networking.service.d/network-pre.conf to systemd.conf, and add
   After=apparmor.service.
 - ifup@.service: Add After=apparmor.service.
 - Add Breaks: on apparmor << 2.9.2-1, which dropped its dependency to
   $remote_fs.

LP: #1438249
2015-05-12 08:08:37 +02:00
Martin Pitt
3d857c210b Revert "ifup@.service: Revert PartOf="
We want this after all, so that e. g. isolating emergency.target and similar
work as before.

This reverts commit fc63e489bd.
2015-04-29 15:57:22 +02:00
Martin Pitt
fc63e489bd ifup@.service: Revert PartOf=
Revert the PartOf= setting from commit 1afebb7d7e. It's not necessary to fix
this bug, and other network related parts like NetworkManager don't go down
together with network.target either.
2015-04-28 17:07:48 +02:00
Martin Pitt
1afebb7d7e ifup@.service: Set IgnoreOnIsolate and PartOf=network.target
With that, "systemctl default" does not shut down network interfaces. Also add
PartOf=network.target, so that stopping network.target also stops network
interfaces.

LP: #1449380
2015-04-28 11:56:24 +02:00
Michael Biebl
db920726c3 Revert "Make apparmor run before networking"
This reverts commit dd2f43c5bc.

The apparmor SysV init script uses
Required-Start: $remote_fs
which leads to a dependency cycle.

That aside, a better fix would be if apparmor shipped a native service
file and hooked that up in network-pre.target.
2015-04-16 13:36:05 +02:00
Martin Pitt
dd2f43c5bc Make apparmor run before networking
To ensure that profiles apply to e. g. dhclient:

- Rename networking.service.d/network-pre.conf to systemd.conf, and add
  After=apparmor.service.
- ifup@.service: Add After=apparmor.service.

LP: #1438249
2015-03-31 08:52:47 +02:00
Michael Biebl
5a1f7e1515 Make the journald to syslog forwarding more robust
by increasing the maximum datagram queue length from 10 to 512.

Closes: #762700
2015-03-29 22:06:03 +02:00
Martin Pitt
929bece532 Enable timesyncd by default
Add a config drop-in to not start if ntp, openntpd, or chrony is installed.

Closes: #755722
2015-02-16 15:38:40 +01:00
Martin Pitt
7ea24cda5e Move all Debian specific units in the systemd package into debian/extra/units/
Simplify debian/systemd.install accordingly. This makes it easier to see where
the .d/ drop-ins go to.
2015-02-16 15:24:36 +01:00