1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

units: rebuild /etc/passwd, the udev hwdb and the journal catalog files on boot

Only when necessary of course, nicely guarded with the new
ConditionNeedsUpdate= condition we added.
This commit is contained in:
Lennart Poettering 2014-06-13 13:10:30 +02:00
parent a55654d598
commit ecde7065f7
9 changed files with 93 additions and 9 deletions

View 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 += \

3
units/.gitignore vendored
View 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
@ -54,12 +55,14 @@
/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

View File

@ -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

View 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

View File

@ -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

View 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

View 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

View File

@ -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

View 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