units: replace a few non-essential API mounts with automount units

This commit is contained in:
Lennart Poettering 2010-05-18 03:10:17 +02:00
parent 835d81db93
commit 670802d4b1
11 changed files with 235 additions and 5 deletions

View File

@ -82,7 +82,16 @@ dist_systemunit_DATA = \
units/sockets.target \
units/swap.target \
units/systemd-initctl.socket \
units/systemd-logger.socket
units/systemd-logger.socket \
units/dev-hugepages.automount \
units/dev-hugepages.mount \
units/dev-mqueue.automount \
units/dev-mqueue.mount \
units/proc-sys-fs-binfmt_misc.automount \
units/proc-sys-fs-binfmt_misc.mount \
units/sys-kernel-debug.automount \
units/sys-kernel-debug.mount \
units/var-run.mount
systemunit_DATA = \
units/basic.target \
@ -404,8 +413,10 @@ install-data-hook:
$(DESTDIR)$(systemunitdir) \
$(DESTDIR)$(sessionunitdir) \
$(DESTDIR)$(systemunitdir)/sockets.target.wants \
$(DESTDIR)$(systemunitdir)/basic.target.wants \
$(DESTDIR)$(pkgsysconfdir)/system \
$(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
$(DESTDIR)$(pkgsysconfdir)/system/local-fs.target.wants \
$(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
$(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
$(DESTDIR)$(pkgsysconfdir)/session \
@ -451,6 +462,15 @@ install-data-hook:
( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
rm -f getty.target && \
$(LN_S) $(systemunitdir)/getty.target getty.target )
( cd $(DESTDIR)$(pkgsysconfdir)/system/local-fs.target.wants && \
rm -f var-run.mount && \
$(LN_S) $(systemunitdir)/var-run.mount var-run.mount )
( cd $(DESTDIR)$(systemunitdir)/basic.target.wants && \
rm -f dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount && \
$(LN_S) ../dev-hugepages.automount dev-hugepages.automount && \
$(LN_S) ../dev-mqueue.automount dev-mqueue.automount && \
$(LN_S) ../proc-sys-fs-binfmt_misc.automount proc-sys-fs-binfmt_misc.automount && \
$(LN_S) ../sys-kernel-debug.automount sys-kernel-debug.automount )
if TARGET_FEDORA
( cd $(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants && \
rm -f prefdm.service && \

View File

@ -48,9 +48,6 @@ static const MountPoint mount_table[] = {
{ "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "devpts", "/dev/pts", "devpts", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
{ "cgroup", "/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "debugfs", "/sys/kernel/debug", "debugfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
{ "binfmt_misc", "/proc/sys/fs/binfmt_misc", "binfmt_misc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
{ "mqueue", "/dev/mqueue", "mqueue", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, false },
};
bool mount_point_is_api(const char *path) {
@ -104,7 +101,7 @@ static int mount_cgroup_controllers(void) {
FILE *f;
char buf [256];
/* Mount all available cgroup controllers. */
/* Mount all available cgroup controllers that are built into the kernel. */
if (!(f = fopen("/proc/cgroups", "re")))
return -ENOENT;

View File

@ -0,0 +1,23 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=Huge Pages File System Automount Point
Before=basic.target
[Automount]
Where=/dev/hugepages

24
units/dev-hugepages.mount Normal file
View File

@ -0,0 +1,24 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=Huge Pages File System
[Mount]
What=hugetlbfs
Where=/dev/hugepages
Type=hugetlbfs

View File

@ -0,0 +1,23 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=POSIX Message Queue File System Automount Point
Before=basic.target
[Automount]
Where=/dev/mqueue

24
units/dev-mqueue.mount Normal file
View File

@ -0,0 +1,24 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=POSIX Message Queue File System
[Mount]
What=mqueue
Where=/dev/mqueue
Type=mqueue

View File

@ -0,0 +1,23 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=Arbitrary Executable File Formats File System Automount Point
Before=basic.target
[Automount]
Where=/proc/sys/fs/binfmt_misc

View File

@ -0,0 +1,24 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=Arbitrary Executable File Formats File System
[Mount]
What=binfmt_misc
Where=/proc/sys/fs/binfmt_misc
Type=binfmt_misc

View File

@ -0,0 +1,23 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=Debug File System Automount Point
Before=basic.target
[Automount]
Where=/sys/kernel/debug

View File

@ -0,0 +1,24 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=Debug File System
[Mount]
What=debugfs
Where=/sys/kernel/debug
Type=debugfs

25
units/var-run.mount Normal file
View File

@ -0,0 +1,25 @@
# This file is part of systemd.
#
# Copyright 2010 Lennart Poettering
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
[Unit]
Name=Runtime Directory
Before=local-fs.target
[Mount]
What=tmpfs
Where=/var/run
Type=tmpfs