mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
remount: consolidate remount-api-vfs and remount-rootfs into one
This has the advantage of removing a confusing warning by mount if the root directory is not listed in fstab.
This commit is contained in:
parent
a888b352eb
commit
2b93b027d3
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
/systemd-remount-fs
|
||||||
/build-aux
|
/build-aux
|
||||||
/test-watchdog
|
/test-watchdog
|
||||||
/test-journal-send
|
/test-journal-send
|
||||||
|
19
Makefile.am
19
Makefile.am
@ -225,7 +225,7 @@ rootlibexec_PROGRAMS = \
|
|||||||
systemd-shutdownd \
|
systemd-shutdownd \
|
||||||
systemd-shutdown \
|
systemd-shutdown \
|
||||||
systemd-modules-load \
|
systemd-modules-load \
|
||||||
systemd-remount-api-vfs \
|
systemd-remount-fs \
|
||||||
systemd-reply-password \
|
systemd-reply-password \
|
||||||
systemd-fsck \
|
systemd-fsck \
|
||||||
systemd-timestamp \
|
systemd-timestamp \
|
||||||
@ -287,7 +287,6 @@ dist_systemunit_DATA = \
|
|||||||
units/sys-kernel-debug.mount \
|
units/sys-kernel-debug.mount \
|
||||||
units/sys-fs-fuse-connections.mount \
|
units/sys-fs-fuse-connections.mount \
|
||||||
units/tmp.mount \
|
units/tmp.mount \
|
||||||
units/remount-rootfs.service \
|
|
||||||
units/printer.target \
|
units/printer.target \
|
||||||
units/sound.target \
|
units/sound.target \
|
||||||
units/bluetooth.target \
|
units/bluetooth.target \
|
||||||
@ -308,7 +307,7 @@ nodist_systemunit_DATA = \
|
|||||||
units/systemd-initctl.service \
|
units/systemd-initctl.service \
|
||||||
units/systemd-shutdownd.service \
|
units/systemd-shutdownd.service \
|
||||||
units/systemd-modules-load.service \
|
units/systemd-modules-load.service \
|
||||||
units/systemd-remount-api-vfs.service \
|
units/systemd-remount-fs.service \
|
||||||
units/systemd-update-utmp-runlevel.service \
|
units/systemd-update-utmp-runlevel.service \
|
||||||
units/systemd-update-utmp-shutdown.service \
|
units/systemd-update-utmp-shutdown.service \
|
||||||
units/systemd-tmpfiles-setup.service \
|
units/systemd-tmpfiles-setup.service \
|
||||||
@ -345,7 +344,7 @@ EXTRA_DIST += \
|
|||||||
units/systemd-initctl.service.in \
|
units/systemd-initctl.service.in \
|
||||||
units/systemd-shutdownd.service.in \
|
units/systemd-shutdownd.service.in \
|
||||||
units/systemd-modules-load.service.in \
|
units/systemd-modules-load.service.in \
|
||||||
units/systemd-remount-api-vfs.service.in \
|
units/systemd-remount-fs.service.in \
|
||||||
units/systemd-update-utmp-runlevel.service.in \
|
units/systemd-update-utmp-runlevel.service.in \
|
||||||
units/systemd-update-utmp-shutdown.service.in \
|
units/systemd-update-utmp-shutdown.service.in \
|
||||||
units/systemd-tmpfiles-setup.service.in \
|
units/systemd-tmpfiles-setup.service.in \
|
||||||
@ -1110,12 +1109,12 @@ systemd_rc_local_generator_LDADD = \
|
|||||||
libsystemd-shared.la
|
libsystemd-shared.la
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
systemd_remount_api_vfs_SOURCES = \
|
systemd_remount_fs_SOURCES = \
|
||||||
src/remount-api-vfs/remount-api-vfs.c \
|
src/remount-fs/remount-fs.c \
|
||||||
src/core/mount-setup.c \
|
src/core/mount-setup.c \
|
||||||
src/core/mount-setup.h
|
src/core/mount-setup.h
|
||||||
|
|
||||||
systemd_remount_api_vfs_LDADD = \
|
systemd_remount_fs_LDADD = \
|
||||||
libsystemd-shared.la
|
libsystemd-shared.la
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
@ -3059,13 +3058,11 @@ systemd-install-data-hook:
|
|||||||
rm -f systemd-update-utmp-shutdown.service && \
|
rm -f systemd-update-utmp-shutdown.service && \
|
||||||
$(LN_S) ../systemd-update-utmp-shutdown.service systemd-update-utmp-shutdown.service )
|
$(LN_S) ../systemd-update-utmp-shutdown.service systemd-update-utmp-shutdown.service )
|
||||||
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
|
( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
|
||||||
rm -f systemd-remount-api-vfs.service \
|
rm -f systemd-remount-fs.service \
|
||||||
fsck-root.service \
|
fsck-root.service \
|
||||||
remount-rootfs.service \
|
|
||||||
tmp.mount && \
|
tmp.mount && \
|
||||||
$(LN_S) ../systemd-remount-api-vfs.service systemd-remount-api-vfs.service && \
|
$(LN_S) ../systemd-remount-fs.service systemd-remount-fs.service && \
|
||||||
$(LN_S) ../fsck-root.service fsck-root.service && \
|
$(LN_S) ../fsck-root.service fsck-root.service && \
|
||||||
$(LN_S) ../remount-rootfs.service remount-rootfs.service && \
|
|
||||||
$(LN_S) ../tmp.mount tmp.mount )
|
$(LN_S) ../tmp.mount tmp.mount )
|
||||||
( cd $(DESTDIR)$(userunitdir) && \
|
( cd $(DESTDIR)$(userunitdir) && \
|
||||||
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \
|
rm -f shutdown.target sockets.target bluetooth.target printer.target sound.target && \
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
#define SPECIAL_FSCK_SERVICE "fsck@.service"
|
#define SPECIAL_FSCK_SERVICE "fsck@.service"
|
||||||
#define SPECIAL_QUOTACHECK_SERVICE "quotacheck.service"
|
#define SPECIAL_QUOTACHECK_SERVICE "quotacheck.service"
|
||||||
#define SPECIAL_QUOTAON_SERVICE "quotaon.service"
|
#define SPECIAL_QUOTAON_SERVICE "quotaon.service"
|
||||||
#define SPECIAL_REMOUNT_ROOTFS_SERVICE "remount-rootfs.service"
|
#define SPECIAL_REMOUNT_FS_SERVICE "systemd-remount-fs.service"
|
||||||
|
|
||||||
/* Services systemd relies on */
|
/* Services systemd relies on */
|
||||||
#define SPECIAL_DBUS_SERVICE "dbus.service"
|
#define SPECIAL_DBUS_SERVICE "dbus.service"
|
||||||
|
@ -211,9 +211,9 @@ static int swap_add_device_links(Swap *s) {
|
|||||||
UNIT(s)->manager->running_as == MANAGER_SYSTEM);
|
UNIT(s)->manager->running_as == MANAGER_SYSTEM);
|
||||||
else
|
else
|
||||||
/* File based swap devices need to be ordered after
|
/* File based swap devices need to be ordered after
|
||||||
* remount-rootfs.service, since they might need a
|
* systemd-remount-fs.service, since they might need a
|
||||||
* writable file system. */
|
* writable file system. */
|
||||||
return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_ROOTFS_SERVICE, NULL, true);
|
return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, NULL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int swap_add_default_dependencies(Swap *s) {
|
static int swap_add_default_dependencies(Swap *s) {
|
||||||
|
@ -78,7 +78,9 @@ int main(int argc, char *argv[]) {
|
|||||||
int k;
|
int k;
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if (!mount_point_is_api(me->mnt_dir))
|
/* Remount the root fs and all API VFS */
|
||||||
|
if (!mount_point_is_api(me->mnt_dir) &&
|
||||||
|
!path_equal(me->mnt_dir, "/"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
log_debug("Remounting %s", me->mnt_dir);
|
log_debug("Remounting %s", me->mnt_dir);
|
2
units/.gitignore
vendored
2
units/.gitignore
vendored
@ -28,7 +28,7 @@ systemd-readahead-replay.service
|
|||||||
serial-getty@.service
|
serial-getty@.service
|
||||||
systemd-kmsg-syslogd.service
|
systemd-kmsg-syslogd.service
|
||||||
systemd-modules-load.service
|
systemd-modules-load.service
|
||||||
systemd-remount-api-vfs.service
|
/systemd-remount-fs.service
|
||||||
systemd-vconsole-setup.service
|
systemd-vconsole-setup.service
|
||||||
systemd-auto-serial-getty.service
|
systemd-auto-serial-getty.service
|
||||||
systemd-shutdownd.service
|
systemd-shutdownd.service
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=File System Quota Check
|
Description=File System Quota Check
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
After=systemd-readahead-collect.service systemd-readahead-replay.service remount-rootfs.service
|
After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service
|
||||||
Before=local-fs.target shutdown.target
|
Before=local-fs.target shutdown.target
|
||||||
ConditionPathExists=/sbin/quotacheck
|
ConditionPathExists=/sbin/quotacheck
|
||||||
|
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
# This file is part of systemd.
|
|
||||||
#
|
|
||||||
# systemd is free software; you can redistribute it and/or modify it
|
|
||||||
# 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
|
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=Remount API VFS
|
|
||||||
DefaultDependencies=no
|
|
||||||
Conflicts=shutdown.target
|
|
||||||
After=systemd-readahead-collect.service systemd-readahead-replay.service
|
|
||||||
Before=local-fs-pre.target local-fs.target shutdown.target
|
|
||||||
Wants=local-fs-pre.target
|
|
||||||
ConditionPathExists=/etc/fstab
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
RemainAfterExit=yes
|
|
||||||
ExecStart=@rootlibexecdir@/systemd-remount-api-vfs
|
|
@ -6,7 +6,7 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Remount Root FS
|
Description=Remount Root and Kernel File Systems
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Conflicts=shutdown.target
|
Conflicts=shutdown.target
|
||||||
After=systemd-readahead-collect.service systemd-readahead-replay.service fsck-root.service
|
After=systemd-readahead-collect.service systemd-readahead-replay.service fsck-root.service
|
||||||
@ -17,4 +17,4 @@ ConditionPathExists=/etc/fstab
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/bin/mount / -o remount
|
ExecStart=@rootlibexecdir@/systemd-remount-fs
|
Loading…
Reference in New Issue
Block a user