summaryrefslogtreecommitdiffstats
path: root/units (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #10117 from keszybz/undynamicifyLennart Poettering2018-10-053-6/+8
|\ | | | | Set DynamicUser=no for networkd, resolved, timesyncd
| * Revert "network: set DynamicUser= to systemd-networkd.service"Zbigniew Jędrzejewski-Szmek2018-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d4e9e574ea0b5d23598a317e68399584d229568b. (systemd.conf.m4 part was already reverted in 5b5d82615011b9827466b7cd5756da35627a1608.) Together those reverts should "fix" #10025 and #10011. ("fix" is in quotes because this doesn't really fix the underlying issue, which is combining DynamicUser= with strict container sandbox, but it avoids the problem by not using that feature in our default installation.) Dynamic users don't work well if the service requires matching configuration in other places, for example dbus policy. This is true for those three services. In effect, distros create the user statically [1, 2]. Dynamic users make more sense for "add-on" services where not creating the user, or more precisely, creating the user lazily, can save resources. For "basic" services, if we are going to create the user on package installation anyway, setting DynamicUser= just creates unneeded confusion. The only case where it is actually used is when somebody forgets to do system configuration. But it's better to have the service fail cleanly in this case too. If we want to turn on some side-effect of DynamicUser=yes for those services, we should just do that directly through fine-grained options. By not using DynamicUser= we also avoid the need to restart dbus. [1] https://salsa.debian.org/systemd-team/systemd/commit/bd9bf307274faca24699c0c2d67cb86f18c0b2cb [2] https://src.fedoraproject.org/rpms/systemd/blob/48ac1cebdedb055d9daf3dfe28c7bde80103f7a1/f/systemd.spec#_473 (Fedora does not create systemd-timesync user.)
| * Revert "resolve: enable DynamicUser= for systemd-resolved.service"Zbigniew Jędrzejewski-Szmek2018-09-201-2/+3
| | | | | | | | | | This reverts commit 0187368cadea183e18c6d575a9d6b7f491a402af. (systemd.conf.m4 part was already reverted in 5b5d82615011b9827466b7cd5756da35627a1608.)
| * Revert "timesyncd: enable DynamicUser="Zbigniew Jędrzejewski-Szmek2018-09-191-1/+2
| | | | | | | | | | | | | | This reverts commit 48d3e88c18258d423c3953372ec4a2e638ab0422. I kept the follow-symlink=false → follow-symlink=true change instact, since we're likely to have existing installations with a symlink now.
| * Revert "unit: drop After=systemd-sysusers.service from timesyncd"Zbigniew Jędrzejewski-Szmek2018-09-191-1/+1
| | | | | | | | This reverts commit be80154827100b19b6cc79a59323791b4f1a409f.
* | emergency: make sure console password agents don't interfere with the ↵Franck Bui2018-09-263-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | emergency shell If for any reason local-fs.target fails at startup while a password is requested by systemd-cryptsetup@.service, we end up with the emergency shell competing with systemd-ask-password-console.service for the console. This patch makes sure that: - systemd-ask-password-console.service is stopped before entering in emergency mode so it won't make any access to the console while the emergency shell is running. - systemd-ask-password-console.path is also stopped so any attempts to restart systemd-cryptsetup in the emergency shell won't restart systemd-ask-password-console.service and kill the emergency shell. - systemd-ask-password-wall.path is stopped so systemd-ask-password-wall.service won't be started as this service pulls the default dependencies in. Fixes: #10131
* | tmpfiles: Order tmpfiles-setup after journaldJoão Paulo Rechi Vita2018-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | systemd-tmpfiles-setup.service needs to be ordered after systemd-journald.service, so entries in /run/log/journal are already created when systemd-tmpfiles tries to adjust its permissions. This is specially problematic for setups using a volatile journal where the initrd does not ship a machine-id (i.e. OSTree-based systems), where logs from the initrd will be inaccessible for users in the systemd-journal group. It also has a side effect of `journalctl --user` failing with "No journal files were opened due to insufficient permissions". Fixes #10128.
* | meson: fix dirname/basename confusion in meson-and-wants.sh install helper ↵Zbigniew Jędrzejewski-Szmek2018-09-201-2/+2
|/ | | | | | | | | | | | (#10126) We would create a useless empty directory under build/. It seems we were lucky and all symlinks were installed into directories which were alredy created because we installed something into the same location earlier. While at it, also add '-v' to 'mkdir -p'. This will print the names of directories as they are created (just once), making it easier to see all of what the install script is doing.
* user-runtime-dir@.service: don't stop on runlevel switch (#10079)Alan Jenkins2018-09-141-0/+1
| | | | | | | | | | | | Followup to commit 13cf422e04b7 ("user@.service: don't kill user manager at runlevel switch") I think there's a general rule that units with `StopWhenUnneeded=yes` need `IgnoreOnIsolate=yes`... But it doesn't apply to `suspend.target` and friends. `printer.target` and friends break on isolate even if we apply the rule[1]. That just leaves `graphical-session.target`, which is a user service. "isolate" is *mostly* a weird attempt to emulate runlevels, so I decided not to worry about it for user services. [1] https://github.com/systemd/systemd/issues/6505#issuecomment-320644819
* user@.service: don't kill user manager at runlevel switchThomas Blume2018-09-131-0/+1
| | | | | | | | Loggin in as root user and then switching the runlevel results in a stop of the user manager, even though the user ist still logged in. That leaves a broken user session. Adding "IgnoreOnIsolate=true" to user@.service fixes this.
* units: assign user-runtime-dir@.service to user-%i.sliceLennart Poettering2018-08-031-0/+1
| | | | | | This service won't use much resources, but it's certainly nicer to see it attached th the user's slice along with user@.service, so that everything we run for a specific user is properly bound into one unit.
* units: order user-runtime-dir@.service after systemd-user-sessions.serviceLennart Poettering2018-08-031-0/+1
| | | | | | | We use systemd-user-sessions.service as barrier when to allow login sessions. With this patch user@.service is ordered after that too, so that any login related code (which user-runtime-dir@.service is) is guaranteed to run after the barrier, and never before.
* units: make sure user-runtime-dir@.service is Type=oneshotLennart Poettering2018-08-031-0/+1
| | | | | We order user@.service after it, hence we need to properly know when it finished starting up.
* units: make sure user@.service runs with dbus still upLennart Poettering2018-07-251-2/+1
| | | | Fixes: #9565
* man: add a description of user@.service, user-runtime-dir@.service, user-*.sliceZbigniew Jędrzejewski-Szmek2018-07-203-0/+3
| | | | Fixes #9590.
* units: let's use two ExecStart= lines instead of ;Lennart Poettering2018-06-201-1/+2
|
* units: fix typo in After=Zbigniew Jędrzejewski-Szmek2018-06-201-1/+1
| | | | Followup for c7668c1ce04fa85370432d197d2ccd9411e85649.
* units: make system-update-pre.target a passive unit (#9349)Lennart Poettering2018-06-202-3/+1
| | | | | | | This is an additional synchronization point normally not needed. Hence, let's make it passive, i.e. pull it in from the unit which wants to be ordered before the update service rather than by the update service itself.
* units: Add new system-update-pre.targetHans de Goede2018-06-193-0/+18
| | | | | | | | | | | | | | | | | | | | | systemd offline-updates allows dropping multiple system update units to be added to system-update.target.wants. As documented in systemd.offline-updates(7) only 1 of these units should actually be active (based on the /system-update symlink) and when that unit is done it should reboot the system. In some cases it is desirable to run a unit whenever booting in offline-updates mode indepedent of which update unit is going to handle the update. One example of this is integration with bootloader code which checks if the previous boot was succesful. Since the active unit will reboot the system when it is done, there is no guarantee that adding such a unit to system-update.target.wants will get it executed always. This commit adds a system-update-pre.target which can be used for units which should always run when booting in offline-updates mode.
* units: switch from system call blacklist to whitelistLennart Poettering2018-06-1412-11/+24
| | | | | | | | | | | | | | | | | | | | | This is generally the safer approach, and is what container managers (including nspawn) do, hence let's move to this too for our own services. This is particularly useful as this this means the new @system-service system call filter group will get serious real-life testing quickly. This also switches from firing SIGSYS on unexpected syscalls to returning EPERM. This would have probably been a better default anyway, but it's hard to change that these days. When whitelisting system calls SIGSYS is highly problematic as system calls that are newly introduced to Linux become minefields for services otherwise. Note that this enables a system call filter for udev for the first time, and will block @clock, @mount and @swap from it. Some downstream distributions might want to revert this locally if they want to permit unsafe operations on udev rules, but in general this shiuld be mostly safe, as we already set MountFlags=shared for udevd, hence at least @mount won't change anything.
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-142-4/+0
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-142-2/+2
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* units: switch udev service to use PrivateMounts=yesLennart Poettering2018-06-121-1/+1
| | | | | Given that PrivateMounts=yes is the "successor" to MountFlags=slave in unit files, let's make use of it for udevd.
* add new portable service frameworkLennart Poettering2018-05-242-0/+28
| | | | | | | | | | | This adds a small service "systemd-portabled" and a matching client "portablectl", which implement the "portable service" concept. The daemon implements the actual operations, is PolicyKit-enabled and is activated on demand with exit-on-idle. Both the daemon and the client are an optional build artifact, enabled by default rhough.
* network: set DynamicUser= to systemd-networkd.serviceYu Watanabe2018-05-221-2/+2
|
* resolve: enable DynamicUser= for systemd-resolved.serviceYu Watanabe2018-05-221-3/+2
|
* unit: drop After=systemd-sysusers.service from timesyncdYu Watanabe2018-05-221-1/+1
| | | | | After=systemd-sysusers.service is not necessary, as timesyncd already enables DynamicUser=.
* units: set RestrictNamespaces=yes to networkd and resolvedYu Watanabe2018-05-112-0/+2
| | | | Closes #8949.
* meson: generate m4 preprocessor from config.h (#8914)Yu Watanabe2018-05-071-1/+1
|
* timesync: expose manager properties on busYu Watanabe2018-05-031-0/+1
|
* unit: tighten sandboxing for logindYu Watanabe2018-04-271-2/+2
|
* logind: split %t directory creation to a helper unitZbigniew Jędrzejewski-Szmek2018-04-253-0/+20
| | | | | | | | | | | | | | | Unfortunately this needs a new binary to do the mount because there's just too many special steps to outsource this to systemd-mount: - EPERM needs to be treated specially - UserRuntimeDir= setting must be obeyed - SELinux label must be adjusted This allows user@.service to be started independently of logind. So 'systemctl start user@nnn' will start the user manager for user nnn. Logind will start it too when the user logs in, and will stop it (unless lingering is enabled) when the user logs out. Fixes #7339.
* Use a dash-truncated drop-in for user-%j.slice configurationZbigniew Jędrzejewski-Szmek2018-04-252-0/+18
| | | | | | | | | | | | | | | | | | | This removes the UserTasksMax= setting in logind.conf. Instead, the generic TasksMax= setting on the slice should be used. Instead of a transient unit we use a drop-in to tweak the default definition of a .slice. It's better to use the normal unit mechanisms instead of creating units on the fly. This will also make it easier to start user@.service independently of logind, or set additional settings like MemoryMax= for user slices. The setting in logind is removed, because otherwise we would have two sources of "truth": the slice on disk and the logind config. Instead of trying to coordinate those two sources of configuration (and maintainer overrides to both), let's just convert to the new one fully. Right now now automatic transition mechanism is provided. logind will emit a hint when it encounters the setting, but otherwise it will be ignored. Fixes #2556.
* unit,meson: drop .in suffix if no substitution is required (#8740)Yu Watanabe2018-04-174-17/+3
|
* time-wait-sync: use watchfile to coordinate with timesyncdPeter A. Bigot2018-04-141-0/+1
| | | | | | | | | | | Systems that have an accurate real-time clock may have an initial unsynchronized time that is close enough to the synchronized time that the final adjustment doesn't trigger a waking "clock set" event. Have timesyncd touch a file in its runtime directory as a secondary signal for synchronization. Continue to support the timerfd-based trigger as a sufficient condition when the watchfile is not present. Closes issue #8683
* units: leave systemd-time-wait-sync disabled by defaultPeter A. Bigot2018-04-141-2/+1
| | | | Also mark its presence conditional on ENABLE_TIMESYNCD.
* fix url for binfmt documentation (#8720)guixxx2018-04-141-1/+2
| | | this file went unnoticed in PR #6223
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-062-26/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Merge pull request #8617 from keszybz/tmpfiles-relaxLennart Poettering2018-04-052-2/+2
|\ | | | | Do not exit with error when systemd-tmpfiles --boot fails
| * tmpfiles: ignore "operational" errors during setupZbigniew Jędrzejewski-Szmek2018-04-052-2/+2
| | | | | | | | | | | | | | | | | | | | We still get the errors logged, but we don't fail the service. This is better for users because rerunning tmpfiles-setup.service a second time is dangerous (c.f. cd9f5b68ce08375eb1d68a4ddaa7a24a5092d7ba). Note that this only touches sd-tmpfiles-setup.service and sd-tmpfiles-setup-dev.service. sd-tmpfiles-clean.service is as before. https://bugzilla.redhat.com/show_bug.cgi?id=1539341
* | units: use `systemctl exit` to kill the user manager (#8648)Filipe Brandenburger2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | Use `systemctl --user --force exit` to implement the systemd-exit user service. This removes our dependence on an external `kill` binary and the concerns about whether they recognize SIGRTMIN+n by name or what their interpretation of SIGRTMIN is. Tested: `systemctl --user start systemd-exit.service` kills the `systemd --user` instance for my user.
* | units: initctl: move the fifo to /run/initctl to match sysvinitMike Gilbert2018-03-302-3/+3
|/ | | | | | The fifo location was moved in sysvinit-2.89. http://git.savannah.nongnu.org/cgit/sysvinit.git/commit/?id=80dbcf3de3c1b83aeaa713a8fe5b8d35d8649af2
* Fix description on suspend-then-hibernate units.Mario Limonciello2018-03-282-2/+2
| | | | Suspend; Idle into hibernate didn't make sense.
* Rename suspend-to-hibernate to suspend-then-hibernateMario Limonciello2018-03-283-5/+5
| | | | | Per some discussion with Gnome folks, they would prefer this name as it's more descriptive of what's happening.
* units: document why systemd-time-wait-sync.service conditions on ↵Lennart Poettering2018-03-221-0/+9
| | | | | CAP_SYS_TIME (#8555) As requested by @evverx in https://github.com/systemd/systemd/pull/8537#issuecomment-375122615
* units: disable systemd-time-sync-wait inside containers (#8537)Peter A. Bigot2018-03-221-0/+2
| | | Fixes #8535
* time-sync-wait: add service (#8494)Peter A. Bigot2018-03-212-0/+27
| | | | This one-shot service waits until the kernel time has been set to synchronized.
* units: Fix SuccessAction that belongs to [Unit] section not [Service] ↵Karol Augustin2018-03-181-1/+1
| | | | section (#8478)
* Introduce suspend-to-hibernate (#8274)Mario Limonciello2018-03-083-0/+37
| | | | | | | | | | | | | | Suspend to Hibernate is a new sleep method that invokes suspend for a predefined period of time before automatically waking up and hibernating the system. It's similar to HybridSleep however there isn't a performance impact on every suspend cycle. It's intended to use with systems that may have a higher power drain in their supported suspend states to prevent battery and data loss over an extended suspend cycle. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
* units: use SuccessAction=reboot where appropriate (#8335)Lennart Poettering2018-03-021-1/+1
| | | We should really use our own native concepts for rebooting.