Commit Graph

122 Commits

Author SHA1 Message Date
Jochen Sprickerhof
2acb27dcf9
Move restarting units after #DEBHELPER#
This makes sure that systemd-sysusers was executed as well as
systemd-tmpfiles to setup proper permissions for /var/log/journal before
systemd-journald is being restarted.
2022-11-01 11:14:45 +01:00
Jochen Sprickerhof
b6e55a055e
Let dh_installsysusers fix the /var/log/journal permissions
dh_installsysusers adds a systemd-sysusers in #DEBHELPER#. Otherwise
it fails with:

/usr/lib/tmpfiles.d/systemd.conf:28: Failed to resolve group 'systemd-journal'.

Regression of fa0aade329.
Closes: #1023248
2022-11-01 09:21:00 +01:00
Luca Boccassi
fa0aade329 Use systemd-sysusers to setup systemd users and groups 2022-10-28 16:14:42 +01:00
Michael Biebl
b1577dabf4 Update comment regarding logind restart
Update the bug reference which contains more details why logind can't be
restarted safely yet.

Gbp-Dch: Ignore
2022-10-12 11:28:48 +02:00
Johannes Schauer Marin Rodrigues
7129300f3c
debian/systemd.postinst: add --root argument to systemctl and systemd-* calls for DPKG_ROOT support 2022-08-21 06:09:25 +02:00
Johannes Schauer Marin Rodrigues
1736b5d034
use systemd-sysusers instead of adduser
This allows dropping the dependency on adduser (reducing the dependency
set) and in turn allows for DPKG_ROOT support of systemd.
2022-08-19 15:55:49 +02:00
Luca Boccassi
c001228ca2 Split systemd-resolved into its own package which takes over /etc/resolv.conf
Closes: #939904
2022-08-04 16:14:05 +01:00
Michael Biebl
11c331f9f1 Use try-restart in systemd-binfmt dpkg trigger 2022-06-09 08:57:09 +02:00
Michael Biebl
551065d648 Add dpkg file trigger for systemd-binfmt to update binfmt registrations 2022-06-03 18:58:38 +02:00
Michael Biebl
33925caa2c Drop obsolete migration code for RAMTMP, TPMTIME and UTC 2021-11-11 22:02:41 +01:00
Michael Biebl
1206c57362 Remove obsolete upgrade code from maintainer scripts 2021-07-30 22:10:06 +02:00
Michael Biebl
54ebb5500e Revert "Trigger a systemctl daemon-reload when init scripts are installed or removed"
Remove the dpkg file trigger which called systemctl daemon-reload whenever
a SysV init script was installed. We have proper support in debhelper
nowadays which makes this superfluous and we want to avoid unnecessary
systemctl daemon-reload calls.
2020-11-19 22:33:24 +01:00
Michael Biebl
4a2d15949f Fix restart of systemd-networkd.socket
We can't restart the socket while systemd-networkd.service is still
active. Instead we stop the socket and ensure, that a try-restart of
systemd-networkd.service also starts the socket.
2020-08-29 16:19:33 +02:00
Balint Reczey
0fc215accc debian/systemd.postinst: Restart systemd-networkd.socket on incompatible change
PassCredentials=yes is replaced with PassPacketInfo=yes and extra padding is
dropped, too.

See: https://github.com/systemd/systemd/pull/15942

Closes: #968589
LP: #1891716
2020-08-20 15:51:29 +02:00
Michael Biebl
a0b2669b77 Add reference to upstream issue for systemd-tmpfiles needing /proc
Gbp-Dch: Ignore
2020-04-18 20:39:24 +02:00
Dan Streetman
80879444bc cleanup ondemand.service symlink
The ondemand.service is removed, so make sure to cleanup its symlink.
2020-04-18 09:39:33 -04:00
Dan Streetman
65f46a7d14 remove Ubuntu-specific ondemand.service
New processors handle scaling/throttling in internal firmware
(e.g. intel_pstate), and do not require OS config.

Additionally, nobody else does this, not even Debian.

And finally, this has caused problems for years, e.g.:

https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1497375
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1503773
https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1480320
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1579278
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1806012
https://bugs.launchpad.net/charm-sysconfig/+bug/1873028
2020-04-16 10:53:10 -04:00
Michael Biebl
846e96c87e Wrap overly long comment
Gbp-Dch: Ignore
2020-04-13 13:57:49 +02:00
Michael Biebl
56407ffb04 Fix systemd-pstore.service enablement symlink on upgrades
It is now started via sysinit.target. Also clean up the symlink on
purge.
2020-04-13 13:57:49 +02: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
0a2772cc01 Enable systemd-pstore.service by default on new installs and upgrades
Closes: #952767
2020-04-02 11:29:57 +02:00
Michael Biebl
ea8765c837 Drop migration code for the switch from DynamicUser=yes to no
This code is no longer needed as it only affected systems between 239-1
and 239-5, i.e. it never affected a stable release.
2020-03-18 23:31:33 +01:00
Michael Biebl
07ea2112bc Drop manual clean up of /var/lib/private/systemd/timesync
This is now done properly by systemd itself when a service switches from
DynamicUser=yes to no.
2020-03-11 13:29:11 +01:00
Michael Biebl
8b0e049feb Don't fail upgrade if /proc is not mounted
Applying ACLs on /var/log/journal via systemd-tmpfiles requires a
mounted /proc. Skip this step if /proc is not available, e.g. in a
chroot.

Closes: #950533
2020-02-04 00:10:41 +01:00
Michael Biebl
0c109a8950 Enable persistent journal
Create /var/log/journal on upgrades and new installs. This enables
persistent journal in auto mode.

Closes: #717388
2020-02-01 02:55:25 +01:00
Michael Biebl
93417d9013 Use more consistent shell script headers
Gbp-Dch: Ignore
2020-01-31 10:46:58 +01:00
Michael Biebl
a168f5d766 Fix processing of dpkg triggers in systemd
We need to use $@ instead of "$@" so we can iterate through the
individual trigger names which are passed as a space separated list in
the second argument.
2020-01-31 10:38:55 +01:00
Michael Biebl
d11f93c7df Drop pre-stretch migration code 2019-05-08 01:33:37 +02:00
Martin Pitt
27cf98a5cb Revert "systemd.postinst: Don't fail on an existing dynamic systemd-timesync user"
Stopping timesyncd should also make the user go away. This was an actual
functional regression in <https://github.com/systemd/systemd/pull/11785>.

This reverts commit 5e35275ec4.
2019-02-21 23:02:51 +01:00
Martin Pitt
5e35275ec4 systemd.postinst: Don't fail on an existing dynamic systemd-timesync user
Some systemd versions have DynamicUser=yes in systemd-timesyncd.service.
adduser does not consider these high UIDs as system user and fails,
which caused package installation failures.
2019-02-21 13:23:11 +01:00
Michael Biebl
b274b4ad5a Remove old state directory of systemd-timesyncd on upgrades
Otherwise timesyncd will fail to update the clock file if it was created
as /var/lib/private/systemd/timesync/clock.
This was the case when the service was using DynamicUser=yes which it no
longer does in v240.

Closes: #918190
2019-01-09 19:03:22 +01:00
Michael Biebl
cc664cb424 Make lintian happy and don't parse/mangle /etc/group directly
delgroup --system will already do the right thing, so we don't need any
hand-written code.

Follow-up for commit a2344f4e8d.

Gbp-Dch: Ignore
2018-11-17 17:22:30 +01:00
Martin Pitt
a2344f4e8d Fix wrong "nobody" group from sysusers.d
Fix our make-sysusers-basic sysusers.d generator to special-case the
nobody group. "nobody" user and "nogroup" group both have the same ID
65534, which is the only special case for Debian's static users/groups.
So specify the gid explicitly, to avoid systemd-sysusers creating a
dynamic system group for "nobody".

Also clean up the group on upgrades.

Thanks to Keh-Ming Luoh for the original patch!

Closes: #912525
2018-11-17 17:11:04 +01:00
Michael Biebl
86e5854c7e Move (re)start of services after daemon-reexec
Otherwise it will fail if the running systemd version is too old.

Follow-up for commit 9c13ce6441.

See https://github.com/systemd/systemd/issues/9621

Gbp-Dch: Ignore
2018-07-18 11:34:29 +02:00
Michael Biebl
9c13ce6441 Make sure adduser has a chance to succeed
If libnss-systemd is active and the service running, adduser will fail
to create a static system user for it:

adduser: The user `systemd-timesync' already exists, but is not a system user. Exiting.

Follow-up for commit bd9bf30727

Gbp-Dch: Ignore
2018-07-16 23:52:46 +02:00
Michael Biebl
bd9bf30727 Go back to statically allocate system users for timesyncd, networkd and resolved
There are currently too many open issues related to D-Bus and the usage
of DynamicUser.

This reverts commit 4a1eb53f52,
commit f786e808ea and partially also
commit 83ccb63f86.

Closes: #902971
2018-07-16 18:51:20 +02:00
Michael Biebl
4a1eb53f52 Stop creating systemd-network and systemd-resolve system user
systemd-networkd.service and systemd-resolved.service now use
DynamicUser=yes.
2018-06-23 00:12:02 +02:00
Michael Biebl
63e31c4970 Stop re-enabling systemd services on every upgrade
This was done so changes to the [Install] section would be applied on
upgrades. Forcefully re-enabling a service might overwrite local
modifications though and thus far, none of the affected services did
actually change its [Install] section. So remove this code from the
maintainer scripts as it was apparently doing more harm then good.

Closes: #869354
2018-01-02 00:27:11 +01:00
Michael Biebl
f786e808ea Stop creating systemd-timesync system user
DynamicUser=yes has been enabled for systemd-timesyncd.service so
allocating a system user statically is no longer necessary.
2017-12-17 01:13:57 +01:00
Michael Biebl
0930f4ce45 Clean up old /var/lib/systemd/clock on upgrade
The clock file used by systemd-timesyncd is now stored in
StateDirectory=systemd/timesync.

Closes: #883605
2017-12-17 01:13:47 +01:00
Martin Pitt
a83ced86d4 Drop long-obsolete systemd-bus-proxy system user
systemd-bus-proxy hasn't been shipped since before stretch and never
created any files. Thus clean up the obsolete system user on upgrades.

Closes: #878182
2017-11-14 22:45:20 +01:00
Michael Biebl
8a40de90f4 (Re)add --quiet flag to addgroup calls
This is now safe with adduser having been fixed to no longer suppress
fatal error messages if --quiet is used.

Closes: #837871
2017-08-22 16:17:33 +02:00
Michael Biebl
75c7beacfd Restart journald on upgrades
This should be safe with v233:
http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/2017-March/014434.html

Closes: #851438

Gbp-Dch: Short
2017-03-06 01:04:20 +01:00
Michael Biebl
9945bfe553 Simplify version checks for save_is_enabled
Stop testing for specific versions. This is no longer necessary as even
the versions in jessie satisfy those requirements.

Also, run the code on upgrades only. Trying to do that on new installs
(even if there is state from a removed but not purged systemd package)
is rather pointless, as systemctl will not be available at this point.
2017-03-03 15:32:57 +01:00
Michael Biebl
0611c836ec Drop version checks which always evaluate to false on upgrades
Instead run the code only on new installations. There might still be
cases where users migrate from sysvinit to systemd, so we don't want to
drop it yet.
2017-03-03 14:06:16 +01:00
Michael Biebl
1463e62fdf Drop no longer needed maintainer scripts migration code 2017-03-03 14:06:16 +01:00
Martin Pitt
f8545fd5a1 Ubuntu: Move ondemand.service from static to runtime enablement
This makes it easier to keep performance, by disabling ondemand.service.

Side issue in LP: #1579278
2016-09-19 22:37:07 +02:00
Martin Pitt
bc96cb3052 systemd.postinst: Drop setcap call for systemd-detect-virt
This hasn't been necessary any more since
https://github.com/systemd/systemd/commit/fdd25311

Drop corresponding libcap2-bin dependency.
2016-09-19 22:36:59 +02:00
Martin Pitt
7215fdbb4c systemd.postinst: Remove systemd-networkd-resolvconf-update.path removal leftover
Closes: #830778
2016-07-11 16:29:53 +02:00
Martin Pitt
56243a17a8 debian/systemd.postinst: Don't fail package installation if systemctl daemon-reload trigger fails
This does not fix the root cause of the reload failures, but at least causes
fewer packages to be in a broken state after upgrade, so that a reboot or
apt-get -f install have a much higher chance in succeeding.

This is more defensive against bugs like https://launchpad.net/bugs/1502097
https://launchpad.net/bugs/1447654.
2016-02-29 11:44:00 +01:00