[systemd-devel] [PATCH 3/3] units: Ubuntu has different mount options for /var/lock & /var/run
Andrew Edmunds
Andrew.Edmunds at yahoo.com.au
Mon Oct 25 06:24:19 PDT 2010
The following entries appear in /lib/init/fstab (Upstart's
private list of mounts):
none /var/run tmpfs mode=0755,nosuid,showthrough 0 0
none /var/lock tmpfs nodev,noexec,nosuid,showthrough 0 0
The "showthrough" option is Upstart specific but the remaining
options should be honoured.
---
Makefile.am | 6 ++++--
units/.gitignore | 2 ++
units/var-lock.mount | 16 ----------------
units/var-lock.mount.m4 | 19 +++++++++++++++++++
units/var-run.mount | 16 ----------------
units/var-run.mount.m4 | 18 ++++++++++++++++++
6 files changed, 43 insertions(+), 34 deletions(-)
delete mode 100644 units/var-lock.mount
create mode 100644 units/var-lock.mount.m4
delete mode 100644 units/var-run.mount
create mode 100644 units/var-run.mount.m4
diff --git a/Makefile.am b/Makefile.am
index f5ad927..8a91166 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -197,8 +197,6 @@ dist_systemunit_DATA = \
units/sys-kernel-security.automount \
units/sys-kernel-security.mount \
units/tmp.mount \
- units/var-lock.mount \
- units/var-run.mount \
units/hwclock-load.service \
units/hwclock-save.service \
units/sysctl.service \
@@ -217,6 +215,8 @@ nodist_systemunit_DATA = \
units/graphical.target \
units/remote-fs.target \
units/multi-user.target \
+ units/var-lock.mount \
+ units/var-run.mount \
units/systemd-initctl.service \
units/systemd-logger.service \
units/systemd-shutdownd.service \
@@ -258,6 +258,8 @@ EXTRA_DIST = \
units/graphical.target.m4 \
units/multi-user.target.m4 \
units/remote-fs.target.m4 \
+ units/var-lock.mount.m4 \
+ units/var-run.mount.m4 \
units/systemd-initctl.service.in \
units/systemd-logger.service.in \
units/systemd-shutdownd.service.in \
diff --git a/units/.gitignore b/units/.gitignore
index 2bd507a..e9b48e1 100644
--- a/units/.gitignore
+++ b/units/.gitignore
@@ -32,3 +32,5 @@ remote-fs.target
systemd-update-utmp-runlevel.service
systemd-update-utmp-shutdown.service
test-env-replace
+var-lock.mount
+var-run.mount
diff --git a/units/var-lock.mount b/units/var-lock.mount
deleted file mode 100644
index f14ea94..0000000
--- a/units/var-lock.mount
+++ /dev/null
@@ -1,16 +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 General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Lock Directory
-Before=local-fs.target
-
-[Mount]
-What=tmpfs
-Where=/var/lock
-Type=tmpfs
-Options=mode=775,gid=lock
diff --git a/units/var-lock.mount.m4 b/units/var-lock.mount.m4
new file mode 100644
index 0000000..0ecba27
--- /dev/null
+++ b/units/var-lock.mount.m4
@@ -0,0 +1,19 @@
+# This file is part of systemd.
+#
+# 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.
+
+[Unit]
+Description=Lock Directory
+Before=local-fs.target
+
+[Mount]
+What=tmpfs
+Where=/var/lock
+Type=tmpfs
+m4_dnl
+m4_ifdef(`TARGET_UBUNTU',
+`Options=nosuid,nodev,noexec',
+`Options=mode=775,gid=lock')
diff --git a/units/var-run.mount b/units/var-run.mount
deleted file mode 100644
index f786289..0000000
--- a/units/var-run.mount
+++ /dev/null
@@ -1,16 +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 General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Runtime Directory
-Before=local-fs.target
-
-[Mount]
-What=tmpfs
-Where=/var/run
-Type=tmpfs
-Options=mode=755
diff --git a/units/var-run.mount.m4 b/units/var-run.mount.m4
new file mode 100644
index 0000000..be7a5ff
--- /dev/null
+++ b/units/var-run.mount.m4
@@ -0,0 +1,18 @@
+# This file is part of systemd.
+#
+# 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.
+
+[Unit]
+Description=Runtime Directory
+Before=local-fs.target
+
+[Mount]
+What=tmpfs
+Where=/var/run
+Type=tmpfs
+m4_ifdef(`TARGET_UBUNTU',
+`Options=nosuid,mode=755',
+`Options=mode=755')
--
1.7.1
More information about the systemd-devel
mailing list