2020-11-09 07:23:58 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2017-11-18 19:35:03 +03:00
#
2010-09-29 03:30:41 +04:00
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
2012-04-12 02:20:58 +04:00
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
2010-09-29 03:30:41 +04:00
# (at your option) any later version.
[Unit]
2013-12-21 05:25:39 +04:00
Description = Create Volatile Files and Directories
2013-04-23 11:56:32 +04:00
Documentation = man:tmpfiles.d(5) man:systemd-tmpfiles(8)
2022-09-14 14:39:10 +03:00
2010-09-29 03:30:41 +04:00
DefaultDependencies = no
2018-09-19 01:03:54 +03:00
After = local-fs.target systemd-sysusers.service systemd-journald.service
2022-09-14 14:39:10 +03:00
Before = sysinit.target
units: add ordering dependencies on initrd-switch-root.target
For shutdown, we queue shutdown.target/start, so in every unit which should be
stopped *before* shutdown, we need both Conflicts and an ordering dependency
with shutdown.target (either Before= or After= would work, because stop jobs
are always ordered before start jobs).
For initrd transition, we queue initrd-switch-root.service/isolate. This
automatically creates a /stop job for every running unit without
IgnoreOnIsolate. But no ordering dependency is created, unless the unit has a
(possibly transitive) ordering dependency on initrd-switch-root.service.
Since most units must stop before the transition, we should add the ordering
dependency. It is nicer to use Before=initrd-switch-root.target for this.
initrd-switch-root.target is ordered before initrd-switch-root.service, so
the effect it the same when both are in a transaction.
Fixes #23745.
To also cover the case where somebody is emergency mode in the initrd and
queues initrd-switch-root.service/start (not isolate), also add
Conflicts=initrd-switch-root.target, so various units are stopped properly.
This extends 2525682565b372b9b83c848bfe89c025fed47a1d to cover all the other
services that are touched. It could be consider "operator error", but it's
easy to make and it's nicer if we can make this more foolproof.
2022-09-14 14:39:10 +03:00
Conflicts = shutdown.target initrd-switch-root.target
Before = shutdown.target initrd-switch-root.target
2013-12-21 05:25:39 +04:00
RefuseManualStop = yes
2010-09-29 03:30:41 +04:00
[Service]
Type = oneshot
RemainAfterExit = yes
2019-12-18 11:14:57 +03:00
ExecStart = systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
2019-07-28 16:00:08 +03:00
SuccessExitStatus = DATAERR CANTCREAT
2022-07-13 12:32:39 +03:00
LoadCredential = tmpfiles.extra
2022-07-15 17:33:20 +03:00
LoadCredential = login.motd
LoadCredential = login.issue
LoadCredential = network.hosts
2022-09-15 21:35:36 +03:00
LoadCredential = ssh.authorized_keys.root