1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00
systemd/src/core
Lennart Poettering 891a4918ef switch-root: try pivot_root() before overmounting /
We should always try to umount the old root dir if possible, instead of
overmounting it -- if that's possible.

The initial ("first") kernel rootfs can never be umounted, hence
for the usual nitrd case we never bothered using pivot_root() and
hence with fully unmounting it. However, fedup now tranisitions twice
during boot, and in that case it is highly desirable that the "second"
root dir is entirely unmounted when we switch to the "third". This patch
makes that possible.

The pivot_root() needs a directory in the "third" root dir, to move the
"second" root dir to. We use /mnt for that, under the assumption that
this directory is likely to exist, and is not itself a mount point.
2012-11-16 18:21:09 +01:00
..
.gitignore execute: support syscall filtering using seccomp filters 2012-07-17 04:17:53 +02:00
audit-fd.c selinux: remove anything PID1-specific from selinux-access.[ch] so that we can reuse it in logind 2012-10-02 17:56:54 -04:00
audit-fd.h audit: turn the audit fd into a static variable 2012-10-02 17:40:09 -04:00
automount.c mount: reword directory empty warning a bit 2012-09-19 09:58:34 +02:00
automount.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
build.h journal: make libgcrypt dependency optional 2012-08-20 16:51:46 +02:00
bus-errors.h selinux: use standard D-Bus error id for access denied 2012-09-24 23:56:35 +02:00
cgroup-attr.c relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
cgroup-attr.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
cgroup.c core: move ManagerRunningAs to shared 2012-09-18 19:53:34 +02:00
cgroup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
condition.c condition: add ConditionFileNotEmpty= 2012-09-11 01:29:46 +02:00
condition.h condition: add ConditionFileNotEmpty= 2012-09-11 01:29:46 +02:00
dbus-automount.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-automount.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-device.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-device.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-execute.c unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
dbus-execute.h unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
dbus-job.c selinux: remove anything PID1-specific from selinux-access.[ch] so that we can reuse it in logind 2012-10-02 17:56:54 -04:00
dbus-job.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-kill.c unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
dbus-kill.h unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
dbus-manager.c dbus-manager: modernize style 2012-11-15 16:30:24 +01:00
dbus-manager.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-mount.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-mount.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-path.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-path.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-service.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-service.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-snapshot.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-snapshot.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-socket.c Revert "Implement SocketUser= and SocketGroup= for [Socket]" 2012-11-06 09:54:17 -05:00
dbus-socket.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-swap.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-swap.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-target.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-target.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-timer.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus-timer.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
dbus-unit.c selinux: remove anything PID1-specific from selinux-access.[ch] so that we can reuse it in logind 2012-10-02 17:56:54 -04:00
dbus-unit.h selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
dbus.c core: move ManagerRunningAs to shared 2012-09-18 19:53:34 +02:00
dbus.h manager: extend performance measurement interface to include firmware/loader times 2012-09-13 18:54:32 +02:00
device.c Properly handle device aliases used as dependencies 2012-10-17 09:54:53 -04:00
device.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
execute.c shared, core: do not always accept numbers in string lookups 2012-10-30 15:41:15 +01:00
execute.h unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
fdset.c relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
fdset.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
hostname-setup.c drop Arch Linux support for reading /etc/rc.conf 2012-11-03 20:11:52 -04:00
hostname-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
ima-setup.c relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
ima-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
initreq.h move libsystemd_core.la sources into core/ 2012-04-11 16:03:51 +02:00
job.c job: avoid recursion into transaction code from job cancelation 2012-10-25 03:21:32 +02:00
job.h job: add comments to JobResult values 2012-10-25 03:21:31 +02:00
kill.c unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
kill.h core: drop KillMode parameter from KillUnit() bus call 2012-07-20 00:10:32 +02:00
killall.c killall: avoid gcc warning about wait name clash 2012-07-19 02:17:11 +02:00
killall.h switch-root: don't wait for processes 2012-07-17 17:44:26 +02:00
kmod-setup.c kmod-setup: mounting efivarfs, *after* we tried to mount it, is pointless 2012-11-04 17:00:57 +01:00
kmod-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
load-dropin.c util: rename join() to strjoin() 2012-07-13 13:41:01 +02:00
load-dropin.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
load-fragment-gperf.gperf.m4 core/load-fragment-gperf: add missing CONDITION_FILE_NOT_EMPTY 2012-11-15 16:00:03 +01:00
load-fragment.c sched: Only setting CPUSchedulingPriority=rr doesn't work 2012-11-15 16:16:45 +01:00
load-fragment.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
locale-setup.c drop Arch Linux support for reading /etc/rc.conf 2012-11-03 19:59:42 -04:00
locale-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
loopback-setup.c loopback: handle EPERM more gracefully 2012-04-13 18:52:53 +02:00
loopback-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
machine-id-setup.c machine-id: properly mount transient machine ID read-only 2012-08-13 16:24:30 +02:00
machine-id-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
macros.systemd.in rpm: expose preset dir as rpm macro and in systemd.pc 2012-09-13 22:17:46 +02:00
main.c hwclock: do not seal the kernel's time-warp call from inside the initrd 2012-10-27 16:31:10 +02:00
Makefile build-sys: add stub makefiles to make emacs easier to use 2012-04-12 13:35:56 +02:00
manager.c manager: connect SIGRTMIN+24 to terminating --user instances 2012-10-18 01:19:35 +02:00
manager.h audit: turn the audit fd into a static variable 2012-10-02 17:40:09 -04:00
mount-setup.c mount-setup: try mounting 'efivarfs' only if the system bootet with EFI 2012-11-04 17:03:48 +01:00
mount-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
mount.c mount: make sure m->where is set before unit_add_exec_dependencies() 2012-10-23 01:53:02 +02:00
mount.h unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
namespace.c nspawn,namespaces: make sure we recursively bind mount things in 2012-08-13 16:25:03 +02:00
namespace.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
org.freedesktop.systemd1.conf move more main systemd parts to core/ 2012-04-12 14:24:40 +02:00
org.freedesktop.systemd1.policy.in.in move more main systemd parts to core/ 2012-04-12 14:24:40 +02:00
org.freedesktop.systemd1.service move more main systemd parts to core/ 2012-04-12 14:24:40 +02:00
path.c core: move ManagerRunningAs to shared 2012-09-18 19:53:34 +02:00
path.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
securebits.h move libsystemd_core.la sources into core/ 2012-04-11 16:03:51 +02:00
selinux-access.c systemd: use structured logging for unit changes 2012-10-18 21:33:52 +02:00
selinux-access.h selinux: remove anything PID1-specific from selinux-access.[ch] so that we can reuse it in logind 2012-10-02 17:56:54 -04:00
selinux-setup.c selinux: rework selinux access check logic 2012-10-02 17:07:00 -04:00
selinux-setup.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
service.c shutdown: readd explicit sync() when shutting down 2012-11-16 01:35:11 +01:00
service.h service: introduce a proper service result if the start limit is hit 2012-08-22 05:02:33 +02:00
shutdown.c shutdown: readd explicit sync() when shutting down 2012-11-16 01:35:11 +01:00
snapshot.c unit: get rid of UnitVTable.suffix, which is now unused 2012-07-10 17:16:50 +02:00
snapshot.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
socket.c Revert "Implement SocketUser= and SocketGroup= for [Socket]" 2012-11-06 09:54:17 -05:00
socket.h Revert "Implement SocketUser= and SocketGroup= for [Socket]" 2012-11-06 09:54:17 -05:00
special.h service: drop special HTTP server target, as it is a bad idea anf Fedora specific 2012-10-31 02:55:04 +01:00
swap.c swap: fix swap behaviour with symlinks 2012-10-29 09:04:25 +00:00
swap.h unit: split off KillContext from ExecContext containing only kill definitions 2012-07-20 00:10:31 +02:00
switch-root.c switch-root: try pivot_root() before overmounting / 2012-11-16 18:21:09 +01:00
switch-root.h switch-root: move switch_root() call into its own .c file 2012-05-21 19:33:39 +02:00
syscall-list.c execute: support syscall filtering using seccomp filters 2012-07-17 04:17:53 +02:00
syscall-list.h execute: support syscall filtering using seccomp filters 2012-07-17 04:17:53 +02:00
sysfs-show.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
system.conf fix typos 2012-09-20 19:12:23 +02:00
systemd.pc.in rpm: expose preset dir as rpm macro and in systemd.pc 2012-09-13 22:17:46 +02:00
target.c target: imply default ordering for PartsOf deps as well 2012-09-18 11:01:34 +02:00
target.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
tcpwrap.c relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
tcpwrap.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
timer.c core: move ManagerRunningAs to shared 2012-09-18 19:53:34 +02:00
timer.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
transaction.c systemd: highlight ordering cycle deletions 2012-11-15 15:59:39 +01:00
transaction.h transaction: add missing emacs and license headers 2012-04-22 15:22:27 +02:00
umount.c shutdown: don't attempt read-only mounts in a container 2012-09-03 18:59:04 -07:00
umount.h use #pragma once instead of foo*foo #define guards 2012-07-19 12:30:59 +02:00
unit-printf.c core: fix %h, %s, %p handling in templates in user session 2012-11-15 15:59:50 +01:00
unit-printf.h unit: split unit_printf() and friends into its own .c file 2012-09-18 11:27:56 +02:00
unit.c systemd: use structured logging for unit changes 2012-10-18 21:33:52 +02:00
unit.h unit-printf: before resolving exec context specifiers check whether the object actually has an exec context 2012-09-18 11:40:01 +02:00
user.conf move more main systemd parts to core/ 2012-04-12 14:24:40 +02:00