Commit Graph

74 Commits

Author SHA1 Message Date
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
Martin Pitt
c59ff5c9ec debian/systemd.postinst: Only try to enable tmp.mount if we actually copied it to /etc
Don't try to enable a generated unit, as that will fail with "No such file or
directory".

LP: #1545707
2016-02-17 16:30:56 +01:00
Martin Pitt
80ac977a90 debian/systemd.postinst: Add missing newline to /etc/adjtime migration.
See corresponding bug in util-linux: https://bugs.debian.org/699554 and
upstream bug: https://github.com/systemd/systemd/issues/2638
2016-02-17 08:38:43 +01:00
Martin Pitt
74bafd0370 Revert "systemd.postinst: Do a daemon-reload after copying tmp.mount"
This turns out to be unnecessary after all.

This reverts commit d98dbe83d5.
2016-02-17 08:18:23 +01:00
Martin Pitt
d98dbe83d5 systemd.postinst: Do a daemon-reload after copying tmp.mount
So that systemctl enable does not fail on enabling.

LP: #1545707
2016-02-15 18:36:03 +01:00
Michael Biebl
9699c28da4 Retrigger cleanup routines which have been missed due to a bug in dpkg
Retrigger cleanup of org.freedesktop.machine1.conf and
hwclock-save.service now that dpkg has been fixed to correctly pass the
old version to postinst on upgrade.

Closes: #802545
2016-01-29 16:17:49 +01:00
Martin Pitt
b8c239e122 Don't restart logind on upgrades any more
This kills X.org (#798097) while logind doesn't save/restore its open fds
(issue #1163), and also gets confused about being idle in between
(LP: #1473800)

See also https://bugzilla.redhat.com/show_bug.cgi?id=1110697 where this was
disabled on Fedora.
2015-10-02 13:38:41 +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
9075313917 Revert networkd calling if-{up,post-down}.d/ scripts
About half of the existing hooks are not relevant or even actively detrimental
when running with networkd. For the relevant ones, a lot of them should be
fixed in the projects themselves (using IP_FREEBIND etc.).

This has also caused some random hangs when restarting networkd or on shutdown,
by triggering #774153. While this needs to be fixed anyway, it makes this bug
much more apparent.

Closes: #798625
2015-09-30 09:33:24 +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
Michael Biebl
8b5ca88faf Add necessary system groups for systemd-journal-remote
Also remove the creation of the systemd-journal-remote group from
systemd.postinst. This is no longer needed as the tmpfiles snippet
requiring that group is now shipped by the systemd-journal-remote
package.
2015-08-30 20:38:56 +02:00
Martin Pitt
c1f6db6f9a systemd.postinst: Avoid confusing error message about /run/systemd/was-enabled not existing on reconfiguring 2015-07-27 08:39:17 +02:00
Martin Pitt
21739fdb05 Revert "systemd/udev postinst: Avoid "The group [...] already exists as a system group. Exiting." warnings"
This reverts commit daf17c2766.

This would cause errors like "already exists as a non-system group" to go
unnoticed. We really should go back to --quiet and fix adduser (#763055).
2015-07-16 15:31:09 +02:00
Martin Pitt
daf17c2766 systemd/udev postinst: Avoid "The group [...] already exists as a system group. Exiting." warnings
LP: #1475094
2015-07-16 07:25:59 +02:00
Martin Pitt
062f460f97 systemd.postinst: Drop the --quiet from the addgroup calls as well
Same reason as above.

Closes: #762275
2015-06-29 17:01:01 +02:00
Martin Pitt
5a9a0e7d25 Stop installing tmp.mount by default
There are still situations where it becomes active through dependencies from
other units, which is surprising, hides existing data in /tmp during runtime,
and it isn't safe to have a tmpfs /tmp on every install scenario.

  - d/rules: Ship tmp.mount in /usr/share/systemd/ instead of
    /lib/systemd/systemd.
  - systemd.postinst: When tmp.mount already was enabled, install tmp.mount
    into /etc and keep it enabled.
  - systemd.postinst: When enabling tmp.mount because of RAMTMP=yes, copy it
    from /usr/share.
  - Drop Don-t-mount-tmp-as-tmpfs-by-default.patch and
    PrivateTmp-shouldn-t-require-tmpfs.patch, not necessary any more.

Closes: #783509
2015-06-11 09:13:34 +02:00
Martin Pitt
627c2aa2d6 systemd.{pre,post}inst: Clean up obsolete upgrade fixes
These applied to upgrades to wheezy or jessie.
2015-05-12 09:24:17 +02:00
Michael Biebl
5ea1b2bd1c Cleanup hwclock-save.service symlinks when upgrading from the jessie version 2015-04-29 16:01:38 +02:00
Adam Conrad
6495e64a1c Trigger a systemctl daemon-reload when init scripts are installed or removed
This fixes startup failures from packages which install init.d scripts with
--no-start or from "make install" third-party project installs.

Closes: #766429
2015-04-07 10:59:12 +02:00
Martin Pitt
5f74d0163f tmpfiles: Avoid creating duplicate ACL entries
Fix cherry-picked from upstream git.

Also add postinst code to clean them up on upgrade.

Closes: #778656
2015-02-24 08:43:31 +01:00
Martin Pitt
03497b4ae5 debian/systemd.postinst: Drop setfacl call for /var/log/journal
This is now done automatically by tmpfiles.d/systemd.conf. If the admin already
set up the directory according to earlier README.Debian, the ACL is already in
place, and if it does not exist it won't get filled until after the next boot
anyway.
2015-02-18 14:24:45 +01: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
c9120537c3 Revert "input" system group creation in systemd.postinst from 218-7
It's already done in udev.postinst.
2015-02-01 22:58:20 +01:00
Martin Pitt
d5f482598e Create system group "input" which was introduced in 215
For 50-udev-default.rules

LP: #1414409
2015-02-01 17:25:15 +01:00
Martin Pitt
d8bb47fa51 debian/systemd.postinst: Don't always restart journald
This currently can't be done without losing the current journal and breaking
attached processes. So only restart it from upgrades < 215-3 (where the socket
location got moved) as an one-time upgrade path from wheezy.

Closes: #771122
2014-12-04 15:32:47 +01:00
Martin Pitt
85f68c6ea1 Create new "systemd-journal-remote" system group
Needed by systemd-tmpfiles-setup.service, otherwise it fails to start up.
2014-11-28 10:52:32 +01:00
Michael Biebl
e7ab0fc6f7 Fix up /dev/log and /dev/initctl symlinks on upgrades
The /dev/log socket and /dev/initctl FIFO have been moved to /run and
replaced by symlinks. Create the symlinks manually on upgrades as well.

Closes: #761340
2014-09-14 16:00:19 +02:00
Michael Biebl
1027a22135 Re-exec systemd and restart services at the end of postinst 2014-09-07 09:50:16 +02:00
Michael Biebl
141aacc09b Add systemd-bus-proxy system user so systemd-bus-proxyd can properly drop its privileges 2014-09-07 09:50:14 +02:00
Michael Biebl
2b9f2a670c Use adduser in quiet mode
* Use adduser in quiet mode when creating the system users/groups to avoid
  warning messages about the missing home directories. Those are created
  dynamically during runtime.
* Set the gecos field when creating the system users.

Closes: #759175
2014-09-06 21:36:18 +02:00
Michael Biebl
a058ae6494 Small comment tweaks and indentation fixes 2014-09-06 21:35:22 +02:00
Jon Severinsson
bb8785d8c4 Do not force-enable default-on services on every upgrade.
Also drops the systemd-networkd, systemd-resolved and systemd-timesyncd
from the set of default services.
2014-08-10 11:04:26 +02:00
Jon Severinsson
350ebb7d89 Try-restart networkd, resolved, and timesyncd after an upgrade.
Just like is already done for journald and logind.
2014-08-10 11:02:33 +02:00
Jon Severinsson
127c3c3d29 Add new systemd service users in systemd postinst. 2014-08-10 10:56:34 +02:00
Michael Biebl
3d3587f270 Make the SysV compat tools try both /run/initctl and /dev/initctl
This makes them usable under sysvinit as PID 1 without requiring any
symlinks.
2014-06-24 12:46:27 +02:00
Michael Biebl
05e5a59af0 Also drop misleading comment when fixing up tmp.conf 2014-04-26 20:09:43 +02:00
Michael Biebl
ec5e27ce8f Do not accidentally re-enable /var/tmp cleaning
when migrating the TMPTIME setting from /etc/default/rcS.
Fix up existing broken configurations.

Closes: #738862
2014-04-26 19:55:31 +02:00
Michael Stapelberg
73b71c7fc5 set capabilities cap_dac_override,cap_sys_ptrace=ep for systemd-detect-virt 2014-02-27 10:44:52 +01:00
Michael Stapelberg
2bcec691e9 do a one-time migration of RAMTMP=
from /etc/default/rcS and /etc/default/tmpfs, i.e. enable tmp.mount

Closes: #738687
2014-02-15 19:33:06 +01:00
Michael Stapelberg
0b1c0f2511 only call setfacl if /var/log/journal actually exists
It doesn’t exist by default, because we don’t yet ship the directory.
Shipping it would turn on persistent logging.
2013-12-21 19:02:59 +01:00
Michael Stapelberg
e563c5db5e run setfacl recursively to also cover already existing files 2013-11-28 22:21:50 +01:00
Guido Günther
4e04639af4 Add systemd-journal group
Users in this group are allowed to see system messages and messages from
other uses.
2013-11-27 21:23:41 +01:00
Michael Stapelberg
c4c50e0c79 allow group adm read access on /var/log/journal
Closes: #717386
2013-11-27 21:22:21 +01:00
Michael Biebl
e14b697bbe Restart systemd-logind.service on upgrades
The CreateSession D-Bus API of systemd-logind changed between v44 and
v204 [1]. As result, newer versions of libpam-systemd fail to register a
new session if they talk to the old systemd-logind process.
Restarting systemd-logind.service when upgrading from v44 means we will
lose existing sessions, but as wheezy still has ConsoleKit as default,
this shouldn't matter that much.  Closes: #717403

[1] https://bugs.freedesktop.org/show_bug.cgi?id=67131
2013-07-25 00:46:10 +02:00
Daniel Schaal
6853903fe2 Add handling of Message Catalog files.
This compiles the files from /usr/lib/systemd/catalog into a
binary database, which is used by journalctl to provide
additional information for log entries. journalctl only uses
the binary database in /var/lib/systemd/catalog/database.

Call journalctl --update-catalog in systemd.postinst and when
triggered by dpkg to update the Message Catalog database.
Also add systemd.postrm to remove the database on purge.

See http://www.freedesktop.org/wiki/Software/systemd/catalog/
2013-07-21 12:10:48 +02:00
Michael Biebl
faacffefa2 Restart the journal service on upgrades 2013-07-18 21:31:50 +02:00
Michael Biebl
47d2341620 Remove the dpkg-triggered debian-enable-units script
This was a temporary workaround for wheezy. Packages should use dh-systemd
now to properly integrate service files with systemd.
Remove the state files on upgrades.
2013-07-18 16:54:22 +02:00
Michael Biebl
10952c547d Update the checks which test if systemd is the active init.
The recommended check is [ -d /run/systemd/system ] as this will also
work with a standalone systemd-logind.
2013-06-20 01:17:00 +02:00
Michael Biebl
d7e5781795 Use a file trigger to automatically enable service and socket units
A lot of packages simply install systemd units but do not enable them.
Running "systemctl enable" in the maintainer scripts is not really an
option since it is not guaranteed that systemd is installed. We
therefore implement a workaround for wheezy which is supposed to go away
in jessie once we have the necessary tools support in debhelper etc.

What the proposed workaround does is:
- Install a dpkg file trigger for /lib/systemd/system which triggers a
  script named /lib/systemd/debian-enable-units every time a package
  installs a systemd unit.
- Run this script also upon initial installation of systemd and once on
  upgrades from earlier releases.

The script in particular does the following:
- Run "systemctl enable" for each service or socket it finds in
  /lib/systemd/system but does that only once, so the administrator can
  disable them if wanted.
- Record the state and installed symlinks. When a package shipping
  systemd units is uninstalled, we remove those symlinks again.
- Use a blacklist for internal services.
- If systemd is not the active init, it will only create a tag file
  and next time we boot with systemd, the script will be run early
  during boot. For that we install a service named
  debian-enable-units.service which is run in basic.target.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=692150
2013-02-09 16:42:15 +01:00