[systemd-commits] 3 commits - Makefile.am src/mount-setup.c units/dev-hugepages.automount units/dev-hugepages.mount units/dev-mqueue.automount units/dev-mqueue.mount units/fedora units/getty at .service.m4 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
Lennart Poettering
lennart at kemper.freedesktop.org
Mon May 17 18:10:24 PDT 2010
Makefile.am | 22 +++++++++++++++++++++-
src/mount-setup.c | 5 +----
units/dev-hugepages.automount | 23 +++++++++++++++++++++++
units/dev-hugepages.mount | 24 ++++++++++++++++++++++++
units/dev-mqueue.automount | 23 +++++++++++++++++++++++
units/dev-mqueue.mount | 24 ++++++++++++++++++++++++
units/fedora/halt.service | 1 +
units/fedora/killall.service | 2 ++
units/fedora/poweroff.service | 1 +
units/fedora/prefdm.service | 1 +
units/fedora/rc-local.service | 4 ++++
units/fedora/reboot.service | 1 +
units/fedora/sysinit.service | 5 ++++-
units/getty at .service.m4 | 3 +++
units/proc-sys-fs-binfmt_misc.automount | 23 +++++++++++++++++++++++
units/proc-sys-fs-binfmt_misc.mount | 24 ++++++++++++++++++++++++
units/sys-kernel-debug.automount | 23 +++++++++++++++++++++++
units/sys-kernel-debug.mount | 24 ++++++++++++++++++++++++
units/var-run.mount | 25 +++++++++++++++++++++++++
19 files changed, 252 insertions(+), 6 deletions(-)
New commits:
commit 670802d4b1d16c3785a695bea6e13b8bf8c8a822
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue May 18 03:10:17 2010 +0200
units: replace a few non-essential API mounts with automount units
diff --git a/Makefile.am b/Makefile.am
index e6366dd..3589b73 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 && \
diff --git a/src/mount-setup.c b/src/mount-setup.c
index e4f2b73..889cf67 100644
--- a/src/mount-setup.c
+++ b/src/mount-setup.c
@@ -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;
diff --git a/units/dev-hugepages.automount b/units/dev-hugepages.automount
new file mode 100644
index 0000000..f17b19d
--- /dev/null
+++ b/units/dev-hugepages.automount
@@ -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
diff --git a/units/dev-hugepages.mount b/units/dev-hugepages.mount
new file mode 100644
index 0000000..8ffff36
--- /dev/null
+++ b/units/dev-hugepages.mount
@@ -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
diff --git a/units/dev-mqueue.automount b/units/dev-mqueue.automount
new file mode 100644
index 0000000..4e343ac
--- /dev/null
+++ b/units/dev-mqueue.automount
@@ -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
diff --git a/units/dev-mqueue.mount b/units/dev-mqueue.mount
new file mode 100644
index 0000000..f0cb5f7
--- /dev/null
+++ b/units/dev-mqueue.mount
@@ -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
diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
new file mode 100644
index 0000000..4466ced
--- /dev/null
+++ b/units/proc-sys-fs-binfmt_misc.automount
@@ -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
diff --git a/units/proc-sys-fs-binfmt_misc.mount b/units/proc-sys-fs-binfmt_misc.mount
new file mode 100644
index 0000000..af8e200
--- /dev/null
+++ b/units/proc-sys-fs-binfmt_misc.mount
@@ -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
diff --git a/units/sys-kernel-debug.automount b/units/sys-kernel-debug.automount
new file mode 100644
index 0000000..b573be9
--- /dev/null
+++ b/units/sys-kernel-debug.automount
@@ -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
diff --git a/units/sys-kernel-debug.mount b/units/sys-kernel-debug.mount
new file mode 100644
index 0000000..7badf80
--- /dev/null
+++ b/units/sys-kernel-debug.mount
@@ -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
diff --git a/units/var-run.mount b/units/var-run.mount
new file mode 100644
index 0000000..aaa1580
--- /dev/null
+++ b/units/var-run.mount
@@ -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
commit 835d81db939bf7a75fcf057462d71777ec475c21
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue May 18 03:08:35 2010 +0200
units: synchronize with shutdown.target
diff --git a/units/fedora/killall.service b/units/fedora/killall.service
index 13bb564..0978107 100644
--- a/units/fedora/killall.service
+++ b/units/fedora/killall.service
@@ -17,6 +17,7 @@
[Unit]
Description=Kill All Processes
+After=shutdown.target
[Service]
Type=finish
diff --git a/units/fedora/prefdm.service b/units/fedora/prefdm.service
index 7df09ac..227ffba 100644
--- a/units/fedora/prefdm.service
+++ b/units/fedora/prefdm.service
@@ -19,6 +19,7 @@
Description=Display Manager
Before=graphical.target
After=basic.target syslog.target messagebus.service haldaemon.service
+Conflicts=shutdown.target
[Service]
ExecStart=/etc/X11/prefdm -nodaemon
diff --git a/units/fedora/rc-local.service b/units/fedora/rc-local.service
index e8284a1..30a2c8a 100644
--- a/units/fedora/rc-local.service
+++ b/units/fedora/rc-local.service
@@ -18,6 +18,7 @@
[Unit]
Description=/etc/rc.local Compatibility
Requires=basic.target
+Conflicts=shutdown.target
# The rcN.d symlink uses the name "local" while the script itself is
# called "rc.local", hence carry both names here.
diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
index ffcc42a..890b489 100644
--- a/units/getty at .service.m4
+++ b/units/getty at .service.m4
@@ -23,6 +23,7 @@ m4_dnl
Description=Getty on %I
Before=getty.target
After=basic.target
+Conflicts=shutdown.target
[Service]
Type=simple
commit 1e3fc6541f92cc1c42ba1b3a7bbe4c8c7b918156
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue May 18 03:08:18 2010 +0200
units: fix execution environment for a few services
diff --git a/units/fedora/halt.service b/units/fedora/halt.service
index acc47b5..06c588f 100644
--- a/units/fedora/halt.service
+++ b/units/fedora/halt.service
@@ -22,6 +22,7 @@ After=shutdown.target killall.service
[Service]
Type=finish
+ValidNoProcess=yes
Environment=INIT_HALT=HALT
Environment=RUNLEVEL=0
ExecStart=/etc/init.d/halt start
diff --git a/units/fedora/killall.service b/units/fedora/killall.service
index 45868dd..13bb564 100644
--- a/units/fedora/killall.service
+++ b/units/fedora/killall.service
@@ -20,4 +20,5 @@ Description=Kill All Processes
[Service]
Type=finish
+ValidNoProcess=yes
ExecStart=/etc/init.d/killall start
diff --git a/units/fedora/poweroff.service b/units/fedora/poweroff.service
index 758b7ca..a8cd680 100644
--- a/units/fedora/poweroff.service
+++ b/units/fedora/poweroff.service
@@ -22,5 +22,6 @@ After=shutdown.target killall.service
[Service]
Type=finish
+ValidNoProcess=yes
Environment=RUNLEVEL=0
ExecStart=/etc/init.d/halt start
diff --git a/units/fedora/rc-local.service b/units/fedora/rc-local.service
index 099bbab..e8284a1 100644
--- a/units/fedora/rc-local.service
+++ b/units/fedora/rc-local.service
@@ -26,4 +26,7 @@ Names=rc-local.service local.service
[Service]
ExecStart=/etc/rc.local start
Type=simple
+TimeoutSec=0
+StandardInput=tty
+ValidNoProcess=yes
SysVStartPriority=99
diff --git a/units/fedora/reboot.service b/units/fedora/reboot.service
index 9aec7aa..da83fa0 100644
--- a/units/fedora/reboot.service
+++ b/units/fedora/reboot.service
@@ -22,5 +22,6 @@ After=shutdown.target killall.service
[Service]
Type=finish
+ValidNoProcess=yes
Environment=RUNLEVEL=6
ExecStart=/etc/init.d/reboot start
diff --git a/units/fedora/sysinit.service b/units/fedora/sysinit.service
index 0d59490..f2098fd 100644
--- a/units/fedora/sysinit.service
+++ b/units/fedora/sysinit.service
@@ -21,4 +21,7 @@ Before=local-fs.target remote-fs.target swap.target sockets.target
[Service]
ExecStart=/etc/rc.d/rc.sysinit
-Type=finish
+Type=forking
+TimeoutSec=0
+StandardInput=tty
+ValidNoProcess=yes
diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
index 9787638..ffcc42a 100644
--- a/units/getty at .service.m4
+++ b/units/getty at .service.m4
@@ -27,3 +27,5 @@ After=basic.target
[Service]
Type=simple
ExecStart=GETTY %I
+Restart=restart-always
+RestartSec=0
More information about the systemd-commits
mailing list