[systemd-commits] 5 commits - Makefile.am man/systemd.unit.xml src/unit.c src/unit-name.c src/unit-name.h TODO units/fsck-root.service.in units/fsck at .service.in units/hwclock-load.service units/quotacheck.service.in units/quotaon.service units/remount-rootfs.service units/sysctl.service units/syslog.socket units/systemd-initctl.service.in units/systemd-initctl.socket units/systemd-kmsg-syslogd.service.in units/systemd-kmsg-syslogd.socket units/systemd-logger.service.in units/systemd-logger.socket units/systemd-remount-api-vfs.service.in units/systemd-shutdownd.service.in units/systemd-shutdownd.socket units/systemd-vconsole-setup.service.in

Lennart Poettering lennart at kemper.freedesktop.org
Wed Oct 20 08:49:33 PDT 2010


 Makefile.am                              |   20 ++++++++++++++++----
 TODO                                     |    4 ++++
 man/systemd.unit.xml                     |   18 +++++++++++-------
 src/unit-name.c                          |   23 +++++++++++++++++++++++
 src/unit-name.h                          |    2 ++
 src/unit.c                               |   11 +++++++++++
 units/fsck-root.service.in               |    1 +
 units/fsck at .service.in                   |    5 +++--
 units/hwclock-load.service               |    1 +
 units/quotacheck.service.in              |    3 ++-
 units/quotaon.service                    |    5 +++--
 units/remount-rootfs.service             |    1 +
 units/sysctl.service                     |    1 +
 units/syslog.socket                      |   27 +++++++++++++++++++++++++++
 units/systemd-initctl.service.in         |    2 +-
 units/systemd-initctl.socket             |    2 +-
 units/systemd-kmsg-syslogd.service.in    |    1 +
 units/systemd-kmsg-syslogd.socket        |   20 --------------------
 units/systemd-logger.service.in          |    6 +++---
 units/systemd-logger.socket              |    4 +++-
 units/systemd-remount-api-vfs.service.in |    1 +
 units/systemd-shutdownd.service.in       |    2 +-
 units/systemd-shutdownd.socket           |    2 +-
 units/systemd-vconsole-setup.service.in  |    1 +
 24 files changed, 119 insertions(+), 44 deletions(-)

New commits:
commit 52f319b29398d36ed8d1a70f68a170c0a85f401d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Oct 20 17:48:01 2010 +0200

    syslog: enable kmsg bridge by default and enable syslogging for early boot services

diff --git a/Makefile.am b/Makefile.am
index 30d68a0..5fcf24f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -185,7 +185,7 @@ dist_systemunit_DATA = \
 	units/systemd-initctl.socket \
 	units/systemd-logger.socket \
 	units/systemd-shutdownd.socket \
-	units/systemd-kmsg-syslogd.socket \
+	units/syslog.socket \
 	units/dev-hugepages.automount \
 	units/dev-hugepages.mount \
 	units/dev-mqueue.automount \
@@ -1048,10 +1048,11 @@ install-data-hook:
 		rm -f session && \
 		$(LN_S) $(pkgsysconfdir)/session session )
 	( cd $(DESTDIR)$(systemunitdir)/sockets.target.wants && \
-		rm -f systemd-initctl.socket systemd-logger.socket systemd-shutdownd.socket && \
+		rm -f systemd-initctl.socket systemd-logger.socket systemd-shutdownd.socket syslog.socket && \
 		$(LN_S) ../systemd-logger.socket systemd-logger.socket && \
 		$(LN_S) ../systemd-initctl.socket systemd-initctl.socket && \
-		$(LN_S) ../systemd-shutdownd.socket systemd-shutdownd.socket )
+		$(LN_S) ../systemd-shutdownd.socket systemd-shutdownd.socket && \
+		$(LN_S) ../syslog.socket syslog.socket )
 	( cd $(DESTDIR)$(systemunitdir)/runlevel1.target.wants && \
 		rm -f systemd-update-utmp-runlevel.service && \
 		$(LN_S) ../systemd-update-utmp-runlevel.service systemd-update-utmp-runlevel.service )
diff --git a/units/fsck-root.service.in b/units/fsck-root.service.in
index 8ddbda9..2f89d0e 100644
--- a/units/fsck-root.service.in
+++ b/units/fsck-root.service.in
@@ -15,4 +15,5 @@ Before=local-fs.target shutdown.target remount-rootfs.service quotacheck.service
 Type=oneshot
 RemainAfterExit=no
 ExecStart=@rootlibexecdir@/systemd-fsck
+StandardOutput=syslog
 FsckPassNo=1
diff --git a/units/fsck at .service.in b/units/fsck at .service.in
index 860c3a6..54caa3c 100644
--- a/units/fsck at .service.in
+++ b/units/fsck at .service.in
@@ -16,3 +16,4 @@ Before=local-fs.target shutdown.target
 Type=oneshot
 RemainAfterExit=no
 ExecStart=@rootlibexecdir@/systemd-fsck %f
+StandardOutput=syslog
diff --git a/units/hwclock-load.service b/units/hwclock-load.service
index d3427e6..3897b39 100644
--- a/units/hwclock-load.service
+++ b/units/hwclock-load.service
@@ -15,6 +15,7 @@ Before=basic.target shutdown.target udev.service
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/sbin/hwclock --systz
+StandardOutput=syslog
 
 # Note the weird semantics if hwclock and the kernel here: the first
 # settimeofday() invocation from userspace is special and may be used
diff --git a/units/quotacheck.service.in b/units/quotacheck.service.in
index f2f1a71..65a7055 100644
--- a/units/quotacheck.service.in
+++ b/units/quotacheck.service.in
@@ -16,6 +16,7 @@ ConditionPathExists=/sbin/quotacheck
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=@rootlibexecdir@/systemd-quotacheck
+StandardOutput=syslog
 
 [Install]
 WantedBy=local-fs.target
diff --git a/units/quotaon.service b/units/quotaon.service
index f8ff219..c527cc4 100644
--- a/units/quotaon.service
+++ b/units/quotaon.service
@@ -16,6 +16,7 @@ ConditionPathExists=/sbin/quotaon
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/sbin/quotaon -aug
+StandardOutput=syslog
 
 [Install]
 WantedBy=local-fs.target
diff --git a/units/remount-rootfs.service b/units/remount-rootfs.service
index 890f8fb..3130901 100644
--- a/units/remount-rootfs.service
+++ b/units/remount-rootfs.service
@@ -16,3 +16,4 @@ Before=local-fs.target shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/bin/mount / -o remount
+StandardOutput=syslog
diff --git a/units/sysctl.service b/units/sysctl.service
index 3980e24..afde580 100644
--- a/units/sysctl.service
+++ b/units/sysctl.service
@@ -16,3 +16,4 @@ Before=basic.target shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=/sbin/sysctl -e -q -p /etc/sysctl.conf
+StandardOutput=syslog
diff --git a/units/syslog.socket b/units/syslog.socket
new file mode 100644
index 0000000..c18da46
--- /dev/null
+++ b/units/syslog.socket
@@ -0,0 +1,27 @@
+#  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.
+
+# See systemd.special(7) for details
+
+[Unit]
+Description=Syslog Socket
+DefaultDependencies=no
+Before=sockets.target
+
+[Socket]
+ListenDatagram=/dev/log
+SocketMode=0666
+
+# The service we activate on incoming traffic is
+# systemd-kmsg-syslogd.service. That doesn't mean however, that this
+# is the main syslog daemon in the system. Another syslog
+# implementation (which might be started via on-boot or another
+# non-socket activation) can take over possession of the socket and
+# terminate systemd-kmsg-syslogd. It could also simply replace the
+# socket in the file system, and leave systemd-kmsg-syslogd untouched.
+
+Service=systemd-kmsg-syslogd.service
diff --git a/units/systemd-initctl.service.in b/units/systemd-initctl.service.in
index 78f16c8..7df3aa6 100644
--- a/units/systemd-initctl.service.in
+++ b/units/systemd-initctl.service.in
@@ -8,7 +8,7 @@
 # See systemd.special(7) for details
 
 [Unit]
-Description=systemd /dev/initctl Compatibility Daemon
+Description=/dev/initctl Compatibility Daemon
 DefaultDependencies=no
 
 [Service]
diff --git a/units/systemd-initctl.socket b/units/systemd-initctl.socket
index bcb54b3..403b322 100644
--- a/units/systemd-initctl.socket
+++ b/units/systemd-initctl.socket
@@ -8,7 +8,7 @@
 # See systemd.special(7) for details
 
 [Unit]
-Description=systemd /dev/initctl Compatibility Socket
+Description=/dev/initctl Compatibility Socket
 DefaultDependencies=no
 Before=sockets.target
 
diff --git a/units/systemd-kmsg-syslogd.service.in b/units/systemd-kmsg-syslogd.service.in
index e2e0f55..adb3750 100644
--- a/units/systemd-kmsg-syslogd.service.in
+++ b/units/systemd-kmsg-syslogd.service.in
@@ -14,3 +14,4 @@ DefaultDependencies=no
 [Service]
 ExecStart=@rootlibexecdir@/systemd-kmsg-syslogd
 NotifyAccess=all
+Sockets=syslog.socket
diff --git a/units/systemd-kmsg-syslogd.socket b/units/systemd-kmsg-syslogd.socket
deleted file mode 100644
index ace06fa..0000000
--- a/units/systemd-kmsg-syslogd.socket
+++ /dev/null
@@ -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 General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-
-# See systemd.special(7) for details
-
-[Unit]
-Description=Syslog Socket
-DefaultDependencies=no
-Before=sockets.target
-
-[Socket]
-ListenDatagram=/dev/log
-SocketMode=0666
-
-[Install]
-WantedBy=basic.target
diff --git a/units/systemd-logger.service.in b/units/systemd-logger.service.in
index 4d9b2c2..d970872 100644
--- a/units/systemd-logger.service.in
+++ b/units/systemd-logger.service.in
@@ -8,9 +8,9 @@
 # See systemd.special(7) for details
 
 [Unit]
-Description=systemd Logging Daemon
-Wants=syslog.target
-After=syslog.target @SPECIAL_SYSLOG_SERVICE@
+Description=Logging Daemon
+DefaultDependencies=no
+After=syslog.socket
 
 [Service]
 ExecStart=@rootlibexecdir@/systemd-logger
diff --git a/units/systemd-logger.socket b/units/systemd-logger.socket
index f62b582..57244a2 100644
--- a/units/systemd-logger.socket
+++ b/units/systemd-logger.socket
@@ -8,7 +8,9 @@
 # See systemd.special(7) for details
 
 [Unit]
-Description=systemd Logging Socket
+Description=Logging Socket
+DefaultDependencies=no
+Before=sockets.target
 
 [Socket]
 ListenStream=@/org/freedesktop/systemd1/logger
diff --git a/units/systemd-remount-api-vfs.service.in b/units/systemd-remount-api-vfs.service.in
index 8d437f5..2ccbe23 100644
--- a/units/systemd-remount-api-vfs.service.in
+++ b/units/systemd-remount-api-vfs.service.in
@@ -16,3 +16,4 @@ Before=local-fs.target shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=@rootlibexecdir@/systemd-remount-api-vfs
+StandardOutput=syslog
diff --git a/units/systemd-shutdownd.service.in b/units/systemd-shutdownd.service.in
index 292c3ed..2214caf 100644
--- a/units/systemd-shutdownd.service.in
+++ b/units/systemd-shutdownd.service.in
@@ -8,7 +8,7 @@
 # See systemd.special(7) for details
 
 [Unit]
-Description=systemd Delayed Shutdown Daemon
+Description=Delayed Shutdown Daemon
 DefaultDependencies=no
 
 [Service]
diff --git a/units/systemd-shutdownd.socket b/units/systemd-shutdownd.socket
index 7652308..0df24cf 100644
--- a/units/systemd-shutdownd.socket
+++ b/units/systemd-shutdownd.socket
@@ -8,7 +8,7 @@
 # See systemd.special(7) for details
 
 [Unit]
-Description=systemd Delayed Shutdown Socket
+Description=Delayed Shutdown Socket
 DefaultDependencies=no
 Before=sockets.target
 
diff --git a/units/systemd-vconsole-setup.service.in b/units/systemd-vconsole-setup.service.in
index 87985ce..19760a9 100644
--- a/units/systemd-vconsole-setup.service.in
+++ b/units/systemd-vconsole-setup.service.in
@@ -16,3 +16,4 @@ Before=basic.target shutdown.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=@rootlibexecdir@/systemd-vconsole-setup
+StandardOutput=syslog
commit 0206d45866ac06ebc26972ad6e4d8f1e46dd56b1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Oct 20 16:43:55 2010 +0200

    quota: fix quotaon command line

diff --git a/units/quotaon.service b/units/quotaon.service
index 4bdcfe4..f8ff219 100644
--- a/units/quotaon.service
+++ b/units/quotaon.service
@@ -15,7 +15,7 @@ ConditionPathExists=/sbin/quotaon
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/sbin/quotaon -anug
+ExecStart=/sbin/quotaon -aug
 
 [Install]
 WantedBy=local-fs.target
commit 9fc507041eb524799a0410839e961ec188a78491
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Oct 20 16:16:45 2010 +0200

    unit: introduce %f specifier to decode file names

diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index e54cafa..f72b947 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -182,13 +182,17 @@
                 <literal>%i</literal> specifier in many of the
                 configuration options. Other specifiers that may be
                 used are <literal>%n</literal>, <literal>%N</literal>,
-                <literal>%p</literal>, <literal>%P</literal> and
-                <literal>%I</literal>, for the full unit name, the
-                unescaped unit name, the prefix name, the unescaped
-                prefix name and the unescaped instance name,
-                respectively. The prefix name here refers to the
-                string before the @, i.e. "getty" in the example
-                above, where "tty3" is the instance name.</para>
+                <literal>%p</literal>, <literal>%P</literal>,
+                <literal>%I</literal> and <literal>%f</literal>, for
+                the full unit name, the unescaped unit name, the
+                prefix name, the unescaped prefix name, the unescaped
+                instance name and the unescaped filename,
+                respectively. The unescaped filename is either the
+                unescaped instance name (if set) with / prepended (if
+                necessary), or the prefix name similarly prepended
+                with /. The prefix name here refers to the string
+                before the @, i.e. "getty" in the example above, where
+                "tty3" is the instance name.</para>
 
                 <para>If a unit file is empty (i.e. has the file size
                 0) or is symlinked to <filename>/dev/null</filename>
diff --git a/src/unit-name.c b/src/unit-name.c
index dbaa4a7..d0cfca6 100644
--- a/src/unit-name.c
+++ b/src/unit-name.c
@@ -427,3 +427,26 @@ char *unit_name_to_path(const char *name) {
 
         return e;
 }
+
+char *unit_name_path_unescape(const char *f) {
+        char *e;
+
+        assert(f);
+
+        if (!(e = unit_name_unescape(f)))
+                return NULL;
+
+        if (e[0] != '/') {
+                char *w;
+
+                w = strappend("/", e);
+                free(e);
+
+                if (!w)
+                        return NULL;
+
+                e = w;
+        }
+
+        return e;
+}
diff --git a/src/unit-name.h b/src/unit-name.h
index 9842db3..e369910 100644
--- a/src/unit-name.h
+++ b/src/unit-name.h
@@ -42,6 +42,8 @@ char *unit_name_build_escape(const char *prefix, const char *instance, const cha
 char *unit_name_escape(const char *f);
 char *unit_name_unescape(const char *f);
 
+char *unit_name_path_unescape(const char *f);
+
 bool unit_name_is_template(const char *n);
 
 char *unit_name_replace_instance(const char *f, const char *i);
diff --git a/src/unit.c b/src/unit.c
index 0797813..ab6eb20 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -1880,6 +1880,16 @@ static char *specifier_instance_unescaped(char specifier, void *data, void *user
         return strdup("");
 }
 
+static char *specifier_filename(char specifier, void *data, void *userdata) {
+        Unit *u = userdata;
+        assert(u);
+
+        if (u->meta.instance)
+                return unit_name_path_unescape(u->meta.instance);
+
+        return unit_name_to_path(u->meta.instance);
+}
+
 char *unit_name_printf(Unit *u, const char* format) {
 
         /*
@@ -1918,6 +1928,7 @@ char *unit_full_printf(Unit *u, const char *format) {
                 { 'P', specifier_prefix_unescaped,    NULL },
                 { 'i', specifier_string,              u->meta.instance },
                 { 'I', specifier_instance_unescaped,  NULL },
+                { 'f', specifier_filename,            NULL },
                 { 0, NULL, NULL }
         };
 
diff --git a/units/fsck at .service.in b/units/fsck at .service.in
index f0ccc8f..860c3a6 100644
--- a/units/fsck at .service.in
+++ b/units/fsck at .service.in
@@ -6,7 +6,7 @@
 #  (at your option) any later version.
 
 [Unit]
-Description=File System Check on %I
+Description=File System Check on %f
 DefaultDependencies=no
 Requires=%i.device
 After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
@@ -15,4 +15,4 @@ Before=local-fs.target shutdown.target
 [Service]
 Type=oneshot
 RemainAfterExit=no
-ExecStart=@rootlibexecdir@/systemd-fsck %I
+ExecStart=@rootlibexecdir@/systemd-fsck %f
commit 980d87505c391682c7d9da2d48a1ba68f35c0339
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Oct 20 16:16:14 2010 +0200

    install: enable quota/fsck-root/hwclock load by default

diff --git a/Makefile.am b/Makefile.am
index 6cad9ad..30d68a0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1037,9 +1037,11 @@ install-data-hook:
 		$(DESTDIR)$(systemunitdir)/runlevel5.target.wants \
 		$(DESTDIR)$(systemunitdir)/multi-user.target.wants \
 		$(DESTDIR)$(pkgsysconfdir)/system \
-		$(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
+		$(DESTDIR)$(pkgsysconfdir)/system/basic.target.wants \
+		$(DESTDIR)$(pkgsysconfdir)/system/local-fs.target.wants \
 		$(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants \
 		$(DESTDIR)$(pkgsysconfdir)/system/graphical.target.wants \
+		$(DESTDIR)$(pkgsysconfdir)/system/getty.target.wants \
 		$(DESTDIR)$(pkgsysconfdir)/session \
 		$(DESTDIR)$(sysconfdir)/xdg/systemd
 	( cd $(DESTDIR)$(sysconfdir)/xdg/systemd/ && \
@@ -1074,10 +1076,12 @@ install-data-hook:
 		$(LN_S) ../systemd-random-seed-save.service systemd-random-seed-save.service )
 	( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
 		rm -f systemd-remount-api-vfs.service \
+			fsck-root.service \
 			remount-rootfs.service \
 			var-run.mount \
 			var-lock.mount && \
 		$(LN_S) ../systemd-remount-api-vfs.service systemd-remount-api-vfs.service && \
+		$(LN_S) ../fsck-root.service fsck-root.service && \
 		$(LN_S) ../remount-rootfs.service remount-rootfs.service && \
 		$(LN_S) ../var-run.mount var-run.mount && \
 		$(LN_S) ../var-lock.mount var-lock.mount )
@@ -1114,9 +1118,16 @@ install-data-hook:
 		$(LN_S) $(systemunitdir)/getty at .service getty at tty4.service && \
 		$(LN_S) $(systemunitdir)/getty at .service getty at tty5.service && \
 		$(LN_S) $(systemunitdir)/getty at .service getty at tty6.service )
+	( cd $(DESTDIR)$(pkgsysconfdir)/system/local-fs.target.wants && \
+		rm -f quotaon.service quotacheck.service && \
+		$(LN_S) $(systemunitdir)/quotacheck.service quotacheck.service && \
+		$(LN_S) $(systemunitdir)/quotaon.service quotaon.service )
 	( cd $(DESTDIR)$(pkgsysconfdir)/system/multi-user.target.wants && \
 		rm -f remote-fs.target && \
 		$(LN_S) $(systemunitdir)/remote-fs.target remote-fs.target )
+	( cd $(DESTDIR)$(pkgsysconfdir)/system/basic.target.wants && \
+		rm -f hwclock-load.service && \
+		$(LN_S) $(systemunitdir)/hwclock-load.service hwclock-load.service )
 	( cd $(DESTDIR)$(systemunitdir)/basic.target.wants && \
 		rm -f dev-hugepages.automount \
 			dev-mqueue.automount \
diff --git a/TODO b/TODO
index 0e7987d..899c986 100644
--- a/TODO
+++ b/TODO
@@ -74,6 +74,10 @@
 
 * parse early boot time env var from dracut
 
+* fix serialization of timers
+
+* add switch to disable pull in retroactively
+
 External:
 
 * patch kernel to add /proc/swaps change notifications
commit f875bcfe35a17d7a77a3a195f9998bb453a38499
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Oct 20 16:15:33 2010 +0200

    quota: enable quotaon/quotacheck in local-fs.target, not basic.target

diff --git a/units/quotacheck.service.in b/units/quotacheck.service.in
index b670c57..f2f1a71 100644
--- a/units/quotacheck.service.in
+++ b/units/quotacheck.service.in
@@ -18,4 +18,4 @@ RemainAfterExit=yes
 ExecStart=@rootlibexecdir@/systemd-quotacheck
 
 [Install]
-WantedBy=basic.target
+WantedBy=local-fs.target
diff --git a/units/quotaon.service b/units/quotaon.service
index 1c4a0cd..4bdcfe4 100644
--- a/units/quotaon.service
+++ b/units/quotaon.service
@@ -18,4 +18,4 @@ RemainAfterExit=yes
 ExecStart=/sbin/quotaon -anug
 
 [Install]
-WantedBy=basic.target
+WantedBy=local-fs.target


More information about the systemd-commits mailing list