chiark / gitweb /
units: rebuild /etc/passwd, the udev hwdb and the journal catalog files on boot
authorLennart Poettering <lennart@poettering.net>
Fri, 13 Jun 2014 11:10:30 +0000 (13:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Jun 2014 11:26:32 +0000 (13:26 +0200)
Only when necessary of course, nicely guarded with the new
ConditionNeedsUpdate= condition we added.

Makefile.am
units/.gitignore
units/systemd-journal-catalog-update.service.in [new file with mode: 0644]
units/systemd-networkd.service.in
units/systemd-sysusers.service.in [new file with mode: 0644]
units/systemd-timesyncd.service.in
units/systemd-tmpfiles-setup.service.in
units/systemd-udev-hwdb-update.service.in [new file with mode: 0644]
units/systemd-udevd.service.in

index 8fd933b..abf8a2b 100644 (file)
@@ -491,6 +491,7 @@ nodist_systemunit_DATA = \
        units/systemd-udevd.service \
        units/systemd-udev-trigger.service \
        units/systemd-udev-settle.service \
+       units/systemd-udev-hwdb-update.service \
        units/debug-shell.service \
        units/initrd-parse-etc.service \
        units/initrd-cleanup.service \
@@ -1783,10 +1784,17 @@ systemd_sysusers_LDADD = \
 rootlibexec_PROGRAMS += \
        systemd-sysusers
 
+nodist_systemunit_DATA += \
+       units/systemd-sysusers.service
+
+SYSINIT_TARGET_WANTS += \
+       systemd-sysusers.service
+
 nodist_sysusers_DATA = \
        sysusers.d/systemd.conf
 
 EXTRA_DIST += \
+       units/systemd-sysusers.service.in \
        sysusers.d/systemd.conf.in
 
 INSTALL_DIRS += \
@@ -2753,19 +2761,23 @@ CLEANFILES += \
 EXTRA_DIST += \
        units/systemd-udevd.service.in \
        units/systemd-udev-trigger.service.in \
-       units/systemd-udev-settle.service.in
+       units/systemd-udev-settle.service.in \
+       units/systemd-udev-hwdb-update.service.in
 
 CLEANFILES += \
        units/systemd-udevd.service \
        units/systemd-udev-trigger.service \
-       units/systemd-udev-settle.service
+       units/systemd-udev-settle.service \
+       units/systemd-udev-hwdb-update.service
 
 SOCKETS_TARGET_WANTS += \
        systemd-udevd-control.socket \
        systemd-udevd-kernel.socket
+
 SYSINIT_TARGET_WANTS += \
        systemd-udevd.service \
-       systemd-udev-trigger.service
+       systemd-udev-trigger.service \
+       systemd-udev-hwdb-update.service
 
 rootbin_PROGRAMS += \
        udevadm
@@ -3540,7 +3552,8 @@ dist_systemunit_DATA += \
 
 nodist_systemunit_DATA += \
        units/systemd-journald.service \
-       units/systemd-journal-flush.service
+       units/systemd-journal-flush.service \
+       units/systemd-journal-catalog-update.service
 
 dist_pkgsysconf_DATA += \
        src/journal/journald.conf
@@ -3557,11 +3570,13 @@ SOCKETS_TARGET_WANTS += \
 
 SYSINIT_TARGET_WANTS += \
        systemd-journald.service \
-       systemd-journal-flush.service
+       systemd-journal-flush.service \
+       systemd-journal-catalog-update.service
 
 EXTRA_DIST += \
        units/systemd-journald.service.in \
        units/systemd-journal-flush.service.in \
+       units/systemd-journal-catalog-update.service.in \
        src/journal/journald-gperf.gperf
 
 CLEANFILES += \
index 45ddab7..8ae6ca8 100644 (file)
@@ -32,6 +32,7 @@
 /systemd-initctl.service
 /systemd-journal-flush.service
 /systemd-journal-gatewayd.service
+/systemd-journal-catalog-update.service
 /systemd-journald.service
 /systemd-kexec.service
 /systemd-localed.service
 /systemd-shutdownd.service
 /systemd-suspend.service
 /systemd-sysctl.service
+/systemd-sysusers.service
 /systemd-timedated.service
 /systemd-timesyncd.service
 /systemd-tmpfiles-clean.service
 /systemd-tmpfiles-setup-dev.service
 /systemd-tmpfiles-setup.service
 /systemd-tmpfiles.service
+/systemd-udev-hwdb-update.service
 /systemd-udev-settle.service
 /systemd-udev-trigger.service
 /systemd-udevd.service
diff --git a/units/systemd-journal-catalog-update.service.in b/units/systemd-journal-catalog-update.service.in
new file mode 100644 (file)
index 0000000..d45381d
--- /dev/null
@@ -0,0 +1,22 @@
+#  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=Rebuild Journal Catalog
+Documentation=man:systemd-journald.service(8) man:journald.conf(5)
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target
+Before=sysinit.target shutdown.target systemd-update-done.service
+RefuseManualStart=yes
+RefuseManualStop=yes
+ConditionNeedsUpdate=/etc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@rootbindir@/journalctl --update-catalog
index 48f4d63..57c3fbf 100644 (file)
@@ -9,7 +9,7 @@
 Description=Network Service
 Documentation=man:systemd-networkd.service(8)
 DefaultDependencies=no
-After=dbus.service network-pre.target
+After=dbus.service network-pre.target systemd-sysusers.service
 Before=network.target
 Wants=network.target
 ConditionCapability=CAP_NET_ADMIN
diff --git a/units/systemd-sysusers.service.in b/units/systemd-sysusers.service.in
new file mode 100644 (file)
index 0000000..e123f39
--- /dev/null
@@ -0,0 +1,22 @@
+#  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=Create System Users
+Documentation=man:sysusers.d(5) man:systemd-sysusers.service(8)
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service
+Before=sysinit.target shutdown.target systemd-update-done.service
+RefuseManualStart=yes
+RefuseManualStop=yes
+ConditionNeedsUpdate=/etc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@rootlibexecdir@/systemd-sysusers
index 3a1bc48..a20621d 100644 (file)
@@ -11,7 +11,7 @@ Documentation=man:systemd-timesyncd.service(8)
 ConditionCapability=CAP_SYS_TIME
 DefaultDependencies=off
 RequiresMountsFor=/var/lib/systemd/clock
-After=systemd-remount-fs.service systemd-tmpfiles-setup.service
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service systemd-sysusers.service
 Before=sysinit.target shutdown.target
 Conflicts=shutdown.target
 Wants=time-sync.target
index 747c9a8..d3c6da8 100644 (file)
@@ -10,7 +10,7 @@ Description=Create Volatile Files and Directories
 Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)
 DefaultDependencies=no
 Conflicts=shutdown.target
-After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target
+After=systemd-readahead-collect.service systemd-readahead-replay.service local-fs.target systemd-sysusers.service
 Before=sysinit.target shutdown.target
 RefuseManualStart=yes
 RefuseManualStop=yes
diff --git a/units/systemd-udev-hwdb-update.service.in b/units/systemd-udev-hwdb-update.service.in
new file mode 100644 (file)
index 0000000..4e7b845
--- /dev/null
@@ -0,0 +1,22 @@
+#  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=Rebuild Hardware Database
+Documentation=man:udev(7) man:systemd-udevd.service(8)
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=systemd-readahead-collect.service systemd-readahead-replay.service systemd-remount-fs.service
+Before=sysinit.target shutdown.target systemd-update-done.service
+RefuseManualStart=yes
+RefuseManualStop=yes
+ConditionNeedsUpdate=/etc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@rootbindir@/udevadm hwdb --update
index ddee015..f6acd6f 100644 (file)
@@ -10,7 +10,7 @@ Description=udev Kernel Device Manager
 Documentation=man:systemd-udevd.service(8) man:udev(7)
 DefaultDependencies=no
 Wants=systemd-udevd-control.socket systemd-udevd-kernel.socket
-After=systemd-udevd-control.socket systemd-udevd-kernel.socket
+After=systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udev-hwdb-update.service systemd-sysusers.service
 Before=sysinit.target
 ConditionPathIsReadWrite=/sys