[systemd-devel] [PATCH 1/6] units: add target for locking all active sessions

Ben Boeckel mathstuf at gmail.com
Sat Oct 27 00:08:51 PDT 2012


---
 Makefile.am                   |  3 +++
 man/systemd.special.xml       |  8 ++++++++
 units/.gitignore              |  1 +
 units/lock.target             | 14 ++++++++++++++
 units/systemd-lock.service.in | 17 +++++++++++++++++
 5 files changed, 43 insertions(+)
 create mode 100644 units/lock.target
 create mode 100644 units/systemd-lock.service.in

diff --git a/Makefile.am b/Makefile.am
index 634c67d..bc1d292 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -266,6 +266,7 @@ dist_systemunit_DATA = \
 	units/kexec.target \
 	units/local-fs.target \
 	units/local-fs-pre.target \
+	units/lock.target \
 	units/remote-fs.target \
 	units/remote-fs-pre.target \
 	units/network.target \
@@ -331,6 +332,7 @@ nodist_systemunit_DATA = \
 	units/systemd-hibernate.service \
 	units/systemd-suspend.service \
 	units/systemd-halt.service \
+	units/systemd-lock.service \
 	units/systemd-poweroff.service \
 	units/systemd-reboot.service \
 	units/systemd-kexec.service \
@@ -379,6 +381,7 @@ EXTRA_DIST += \
 	units/systemd-udev-settle.service \
 	units/debug-shell.service.in \
 	units/systemd-hibernate.service.in \
+	units/systemd-lock.service.in \
 	units/systemd-suspend.service.in \
 	units/quotaon.service.in \
 	introspect.awk \
diff --git a/man/systemd.special.xml b/man/systemd.special.xml
index 3e5f653..7a16537 100644
--- a/man/systemd.special.xml
+++ b/man/systemd.special.xml
@@ -68,6 +68,7 @@
                 <filename>kexec.target</filename>,
                 <filename>local-fs.target</filename>,
                 <filename>local-fs-pre.target</filename>,
+                <filename>lock.target</filename>,
                 <filename>mail-transfer-agent.target</filename>,
                 <filename>multi-user.target</filename>,
                 <filename>network.target</filename>,
@@ -376,6 +377,13 @@
                                 </listitem>
                         </varlistentry>
                         <varlistentry>
+                                <term><filename>lock.target</filename></term>
+                                <listitem>
+                                        <para>A special target unit
+                                        for locking all active sessions.</para>
+                                </listitem>
+                        </varlistentry>
+                        <varlistentry>
                                 <term><filename>mail-transfer-agent.target</filename></term>
                                 <listitem>
                                         <para>The mail transfer agent
diff --git a/units/.gitignore b/units/.gitignore
index c72e2cb..5098163 100644
--- a/units/.gitignore
+++ b/units/.gitignore
@@ -2,6 +2,7 @@
 /systemd-journal-flush.service
 /systemd-hibernate.service
 /systemd-suspend.service
+/systemd-lock.service
 /console-getty.service
 /systemd-journald.service
 /user at .service
diff --git a/units/lock.target b/units/lock.target
new file mode 100644
index 0000000..ab23664
--- /dev/null
+++ b/units/lock.target
@@ -0,0 +1,14 @@
+#  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=Lock-Sessions
+Documentation=man:systemd.special(7)
+DefaultDependencies=no
+Requires=systemd-lock.service
+After=systemd-lock.service
+AllowIsolate=yes
diff --git a/units/systemd-lock.service.in b/units/systemd-lock.service.in
new file mode 100644
index 0000000..ea5455a
--- /dev/null
+++ b/units/systemd-lock.service.in
@@ -0,0 +1,17 @@
+#  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=Lock-Sessions
+Documentation=man:systemd-suspend.service(8)
+DefaultDependencies=no
+Requires=lock.target
+After=lock.target
+
+[Service]
+Type=oneshot
+ExecStart=@rootbindir@/loginctl lock-sessions
-- 
1.7.12.1



More information about the systemd-devel mailing list