summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-19Merge pull request #3987 from keszybz/console-color-setupLennart Poettering
Rework console color setup
2016-08-19Merge pull request #3955 from keszybz/fix-preset-allLennart Poettering
Fix preset-all
2016-08-19Merge pull request #3961 from keszybz/pr/3924Lennart Poettering
Add documentation to #3924
2016-08-19man: document that "systemctl switch-root" tries hard to pass state across ↵Lennart Poettering
(#3995) As suggested: https://github.com/systemd/systemd/pull/3958#issuecomment-240410958 Let's document that we try hard to pass system state from the initrd to the host, and even compare the systemd binary paths.
2016-08-19Merge pull request #3997 from poettering/codition-udev-fixZbigniew Jędrzejewski-Szmek
Trivial fixes to udev and condition tests
2016-08-19terminal-util: use getenv_bool for $SYSTEMD_COLORSZbigniew Jędrzejewski-Szmek
This changes the semantics a bit: before, SYSTEMD_COLORS= would be treated as "yes", same as SYSTEMD_COLORS=xxx and SYSTEMD_COLORS=1, and only SYSTEMD_COLORS=0 would be treated as "no". Now, only valid booleans are treated as "yes". This actually matches how $SYSTEMD_COLORS was announced in NEWS.
2016-08-19systemd: ignore lack of tty when checking whether colors should be enabledZbigniew Jędrzejewski-Szmek
When started by the kernel, we are connected to the console, and we'll set TERM properly to some value in fixup_environment(). We'll then enable or disable colors based on the value of $SYSTEMD_COLORS and $TERM. When reexecuting, TERM should be already set, so we can use this value. Effectively, behaviour is the same as before affd7ed1a was reverted, but instead of reopening the console before configuring color output, we just ignore what stdout is connected to and decide based on the variables only.
2016-08-19Merge pull request #3992 from poettering/hostname-fix2Ronny Chevalier
some hostname fixes, triggered by #3979
2016-08-19tests: let's stick to 8ch indenting, in perl code tooLennart Poettering
2016-08-19test: always check whether condition allocation workedLennart Poettering
Our tests should test for OOM too explicitly, hence fix the test accordingly
2016-08-19shared/install: properly report masked units listed in Also=Zbigniew Jędrzejewski-Szmek
A masked unit is listed in Also=: $ systemctl cat test1 test2 →# /etc/systemd/system/test1.service [Unit] Description=test service 1 [Service] Type=oneshot ExecStart=/usr/bin/true [Install] WantedBy=multi-user.target Also=test2.service Alias=alias1.service →# /dev/null $ systemctl --root=/ enable test1 (before) Created symlink /etc/systemd/system/alias1.service → /etc/systemd/system/test1.service. Created symlink /etc/systemd/system/multi-user.target.wants/test1.service → /etc/systemd/system/test1.service. The unit files have no installation config (WantedBy, RequiredBy, Also, Alias settings in the [Install] section, and DefaultInstance for template units). This means they are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: 1) A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. 2) A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. 3) A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...). 4) In case of template units, the unit is meant to be enabled with some instance name specified. (after) Created symlink /etc/systemd/system/alias1.service → /etc/systemd/system/test1.service. Created symlink /etc/systemd/system/multi-user.target.wants/test1.service → /etc/systemd/system/test1.service. Unit /etc/systemd/system/test2.service is masked, ignoring.
2016-08-19units: install user units as real files, not symlinks to ../system/Zbigniew Jędrzejewski-Szmek
This was causing preset-all --global to create symlinks: $ systemctl preset-all --global --root=/var/tmp/inst1 Created symlink /var/tmp/inst1/etc/systemd/user/shutdown.target → /usr/lib/systemd/user/../system/shutdown.target. Created symlink /var/tmp/inst1/etc/systemd/user/sockets.target → /usr/lib/systemd/user/../system/sockets.target. Created symlink /var/tmp/inst1/etc/systemd/user/timers.target → /usr/lib/systemd/user/../system/timers.target. Created symlink /var/tmp/inst1/etc/systemd/user/paths.target → /usr/lib/systemd/user/../system/paths.target. Created symlink /var/tmp/inst1/etc/systemd/user/bluetooth.target → /usr/lib/systemd/user/../system/bluetooth.target. Created symlink /var/tmp/inst1/etc/systemd/user/printer.target → /usr/lib/systemd/user/../system/printer.target. Created symlink /var/tmp/inst1/etc/systemd/user/sound.target → /usr/lib/systemd/user/../system/sound.target. Created symlink /var/tmp/inst1/etc/systemd/user/smartcard.target → /usr/lib/systemd/user/../system/smartcard.target. Created symlink /var/tmp/inst1/etc/systemd/user/busnames.target → /usr/lib/systemd/user/../system/busnames.target. It is better to create units in a state that completely matches the presets, i.e. preset-all should do nothing when invoked immediately after installation. I'm sure it was confusing to users too, suggesting that system and user units may somehow alias each other.
2016-08-19units: synchronize Makefile and presets settingsZbigniew Jędrzejewski-Szmek
Enable reboot.target and disable exit.target: the first is used on normal machines, the second only in containers, and the more general one should be enabled by default. Also fix the Makefile to match what preset-all does. With this and the previous commits, doing "make instal DESTDIR=…" followed by "systemctl preset-all --root=…" doesn't result in any changes.
2016-08-19units: enable systemd-networkd-wait-online.service, disable all ↵Zbigniew Jędrzejewski-Szmek
journal-remote stuff The preset for systemd-networkd-wait-online.service should match whatever we do for systemd-networkd.service. s-n-wait-online.service is only pulled in when some other unit pulls in network-online.target, otherwise it's not used. But if something pulls in network-online.target, they should expect s-n-wait-online.service to be active iff systemd-networkd.service is active. OTOH, the journal-remote and journal-upload services should be disabled by default, since they don't do anything without additional configuration.
2016-08-19shared/install: when creating symlinks, keep existing relative symlinksZbigniew Jędrzejewski-Szmek
Running preset-all on a system installed from rpms or even created using make install would remove and recreate a lot of symlinks, changing relative to absolute symlinks. In general relative symlinks are nicer, so there is no reason to change them, and those spurious changes were obscuring more interesting stuff. $ make install DESTDIR=/var/tmp/inst1 $ systemctl preset-all --root=/var/tmp/inst1 (before) Removed /var/tmp/inst1/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service. Created symlink /var/tmp/inst1/etc/systemd/system/ctrl-alt-del.target → /usr/lib/systemd/system/exit.target. Removed /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/remote-fs.target. Created symlink /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/remote-fs.target → /usr/lib/systemd/system/remote-fs.target. Created symlink /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/machines.target → /usr/lib/systemd/system/machines.target. Created symlink /var/tmp/inst1/etc/systemd/system/sockets.target.wants/systemd-journal-remote.socket → /usr/lib/systemd/system/systemd-journal-remote.socket. Removed /var/tmp/inst1/etc/systemd/system/sockets.target.wants/systemd-networkd.socket. Created symlink /var/tmp/inst1/etc/systemd/system/sockets.target.wants/systemd-networkd.socket → /usr/lib/systemd/system/systemd-networkd.socket. Removed /var/tmp/inst1/etc/systemd/system/getty.target.wants/getty@tty1.service. Created symlink /var/tmp/inst1/etc/systemd/system/getty.target.wants/getty@tty1.service → /usr/lib/systemd/system/getty@.service. Created symlink /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/systemd-journal-upload.service → /usr/lib/systemd/system/systemd-journal-upload.service. Removed /var/tmp/inst1/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service. Created symlink /var/tmp/inst1/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service → /usr/lib/systemd/system/systemd-timesyncd.service. Removed /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/systemd-resolved.service. Created symlink /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/systemd-resolved.service → /usr/lib/systemd/system/systemd-resolved.service. Removed /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/systemd-networkd.service. Created symlink /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/systemd-networkd.service → /usr/lib/systemd/system/systemd-networkd.service. (after) Removed /var/tmp/inst1/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service. Created symlink /var/tmp/inst1/etc/systemd/system/ctrl-alt-del.target → /usr/lib/systemd/system/exit.target. Created symlink /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/machines.target → /usr/lib/systemd/system/machines.target. Created symlink /var/tmp/inst1/etc/systemd/system/sockets.target.wants/systemd-journal-remote.socket → /usr/lib/systemd/system/systemd-journal-remote.socket. Created symlink /var/tmp/inst1/etc/systemd/system/multi-user.target.wants/systemd-journal-upload.service → /usr/lib/systemd/system/systemd-journal-upload.service.
2016-08-19shared/install: move root skipping into create_symlink()Zbigniew Jędrzejewski-Szmek
No functional change intended.
2016-08-19man: describe what symlinks to unit do, and specify that presets must use ↵Zbigniew Jędrzejewski-Szmek
real names The man pages didn't ever mention that symlinks to units can be created, and what exactly this means. Fix that omission, and disallow presets on alias names.
2016-08-19shared/install: ignore unit symlinks when doing preset-allZbigniew Jędrzejewski-Szmek
Before, when interating over unit files during preset-all, behaviour was the following: - if we hit the real unit name first, presets were queried for that name, and that unit was enabled or disabled accordingly, - if we hit an alias first (one of the symlinks chaining to the real unit), we checked the presets using the symlink name, and then proceeded to enable or disable the real unit. E.g. for systemd-networkd.service we have the alias dbus-org.freedesktop.network1.service (/usr/lib/systemd/system/dbus-org.freedesktop.network1.service), but the preset is only for the systemd-networkd.service name. The service would be enabled or disabled pseudorandomly depending on the order of iteration. For "preset", behaviour was analogous: preset on the alias name disabled the service (following the default disable policy), preset on the "real" name applied the presets. With the patch, for "preset" and "preset-all" we silently skip symlinks. This gives mostly the right behaviour, with the limitation that presets on aliases are ignored. I think that presets on aliases are not that common (at least my preset files on Fedora don't exhibit any such usage), and should not be necessary, since whoever installs the preset can just refer to the real unit file. It would be possible to overcome this limitation by gathering a list of names of a unit first, and then checking whether *any* of the names matches the presets list. That would require a significant redesign of the code, and be a lot slower (since we would have to fully read all unit directories to preset one unit) to so I'm not doing that for now. With this patch, two properties are satisfied: - preset-all and preset are idempotent, and the second and subsequent invocations do not produce any changes, - preset-all and preset for a specific name produce the same state for that unit. Fixes #3616.
2016-08-19shared/install: remove unused paramater and add more commentsZbigniew Jędrzejewski-Szmek
2016-08-19systemctl: fix preset-all with missing /etc/systemd/systemZbigniew Jędrzejewski-Szmek
If the directory is missing, we can assume that those pesky symlinks are gone too.
2016-08-19hwdb: let's no abbreivate HORIZONTAL as HORIZ (#3994)Lennart Poettering
I think I am developing OCD... Let's fix this before this actually gets used in the wild. A follow-up for #3986 (5fc9e4abb41e7f58f6c308f54881c596713fba75).
2016-08-19man: minor wording fixesLennart Poettering
2016-08-19man: don't claim we replace spaces by dashes when cleaning up hostnamesLennart Poettering
Let's make sure the man page actually documents what is implemented, i.e. "Lennart's PC" turns into "LennartsPC" when we clean up the name.
2016-08-19man: document that static/transient hostnames may be 64 chars at maxLennart Poettering
2016-08-19tests: add test from #3979Lennart Poettering
Let's add one more test that came up during the discussion of an issue. The selected name with 69 chars is above the Linux hostname limit of 64.
2016-08-19Merge pull request #3990 from AnchorCat/networkd-fixesLennart Poettering
networkd: various fixes for route configuration
2016-08-19Merge pull request #3988 from keszybz/journald-dynamic-usersLennart Poettering
Journald dynamic users
2016-08-19hwdb: add resolution for the Dell Precision 5510 (#3989)Peter Hutterer
https://bugs.freedesktop.org/show_bug.cgi?id=97347
2016-08-18journald: do not create split journals for dynamic usersZbigniew Jędrzejewski-Szmek
Dynamic users should be treated like system users, and their logs should end up in the main system journal.
2016-08-18core/dynamic-users: warn when creation of symlinks for dynamic users failsZbigniew Jędrzejewski-Szmek
Also return the first error, since it's most likely to be interesting. If unlink fails, symlink will usually return EEXIST.
2016-08-18logind: update empty and "infinity" handling for [User]TasksMax (#3835)Tejun Heo
The parsing functions for [User]TasksMax were inconsistent. Empty string and "infinity" were interpreted as no limit for TasksMax but not accepted for UserTasksMax. Update them so that they're consistent with other knobs. * Empty string indicates the default value. * "infinity" indicates no limit. While at it, replace opencoded (uint64_t) -1 with CGROUP_LIMIT_MAX in TasksMax handling. v2: Update empty string to indicate the default value as suggested by Zbigniew Jędrzejewski-Szmek. v3: Fixed empty UserTasksMax handling.
2016-08-18Merge pull request #3986 from whot/wip/click-wheel-angle-horizZbigniew Jędrzejewski-Szmek
Add udev property for horizontal wheel click angles
2016-08-18Merge pull request #3865 from poettering/remove-ipcZbigniew Jędrzejewski-Szmek
add RemoveIPC= service file setting
2016-08-18Revert "pid1: reconnect to the console before being re-executed"Zbigniew Jędrzejewski-Szmek
This reverts commit affd7ed1a923b0df8479cff1bd9eafb625fdaa66. > So it looks like make_console_stdio() has bad side effect. More specifically it > does a TIOCSCTTY ioctl (via acquire_terminal()) which sees to disturb the > process which was using/owning the console. Fixes #3842. https://bugs.debian.org/834367 https://bugzilla.redhat.com/show_bug.cgi?id=1367766
2016-08-18systemd: warn when setrlimit failsZbigniew Jędrzejewski-Szmek
This should make it easier to figure things out.
2016-08-19hwdb: add a udev property for a wheel click angle on horiz wheelsPeter Hutterer
The Logitech MX Master has a horizontal scroll wheel with a different click angle than the vertical one. Add a new property for this case, we can't add values to the normal one without risking upsetting existing parsers. Fixes #3947
2016-08-19libudev: fix typo in commentPeter Hutterer
2016-08-18hostnamectl: rework pretty hostname validation (#3985)Lennart Poettering
Rework 17eb9a9ddba3f03fcba33445c1c1eedeb948da04 a bit. Let's make sure we don't clobber the input parameter args[1], following our coding style to not clobber parameters unless explicitly indicated. (in particular, as we don't want to have our changes appear in the command line shown in "ps"...) No functional change.
2016-08-19nss-mymachines: avoid connecting to dbus from inside dbus-daemonLennart Poettering
Inspired from the new logic in nss-systemd let's make sure we don't end up deadlocking in nss-mymachines either in case dbus-daemon tries to a look up a name and we want to connect to the bus. This case is much simpler though, as there's no point in resolving virtual machine UIDs by dbus-daemon as those should never be able to connect to the host's busses.
2016-08-19core: bypass dynamic user lookups from dbus-daemonLennart Poettering
dbus-daemon does NSS name look-ups in order to enforce its bus policy. This might dead-lock if an NSS module use wants to use D-Bus for the look-up itself, like our nss-systemd does. Let's work around this by bypassing bus communication in the NSS module if we run inside of dbus-daemon. To make this work we keep a bit of extra state in /run/systemd/dynamic-uid/ so that we don't have to consult the bus, but can still resolve the names. Note that the normal codepath continues to be via the bus, so that resolving works from all mount namespaces and is subject to authentication, as before. This is a bit dirty, but not too dirty, as dbus daemon is kinda special anyway for PID 1.
2016-08-19clean-ipc: debug log about all remove IPC objectsLennart Poettering
2016-08-19core: add RemoveIPC= settingLennart Poettering
This adds the boolean RemoveIPC= setting to service, socket, mount and swap units (i.e. all unit types that may invoke processes). if turned on, and the unit's user/group is not root, all IPC objects of the user/group are removed when the service is shut down. The life-cycle of the IPC objects is hence bound to the unit life-cycle. This is particularly relevant for units with dynamic users, as it is essential that no objects owned by the dynamic users survive the service exiting. In fact, this patch adds code to imply RemoveIPC= if DynamicUser= is set. In order to communicate the UID/GID of an executed process back to PID 1 this adds a new "user lookup" socket pair, that is inherited into the forked processes, and closed before the exec(). This is needed since we cannot do NSS from PID 1 due to deadlock risks, However need to know the used UID/GID in order to clean up IPC owned by it if the unit shuts down.
2016-08-18core: move obsolete properties to the end of vtablesLennart Poettering
This makes it easier to discern the relevant and obsolete parts of the vtables, and in particular helps when comparing introspection data with the actual vtable definitions.
2016-08-18core: make use of uid_is_valid() when checking for UID validityLennart Poettering
2016-08-18clean-ipc: shorten code a bitLennart Poettering
2016-08-18clean-ipc: don't filter out '.' and '..' twiceLennart Poettering
2016-08-18unit: remove orphaned cgroup_netclass_id fieldLennart Poettering
2016-08-18networkd: use RT_TABLE_MAIN by defaultMichael Chapman
The default route table used by sd-netlink (and iproute2) is RT_TABLE_MAIN, not RT_TABLE_DEFAULT. Ensure networkd has the same idea.
2016-08-18networkd: do not touch link_messages when expiring routesMichael Chapman
link_messages is used during link configuration to advance the link state machine through SETTING_ADDRESSES -> SETTING_ROUTES -> CONFIGURED. If a route expires in the middle of this, it is possible for link_messages to hit zero inside route_expire_callback, rather than in route_handler or address_handler where it would trigger the next step in configuration. Should this happen, the link will not complete configuration, and it may not have its static routes configured. Since route_expire_callback does not need to do anything once the expired route has been removed from the kernel, it is safe to simply not account for the netlink request.
2016-08-17Merge pull request #3946 from keszybz/open-journal-rootLennart Poettering
Make journalctl more flexible