From 12cabd751919122551b6eb73850b35fbe565c679 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 28 Oct 2010 10:44:00 -0400 Subject: Simplify some things with ConditionPathExists. --- systemd/fedora-configure | 26 +++++++++++--------------- systemd/fedora-init-crypto | 2 +- systemd/system/fedora-configure.service | 2 ++ systemd/system/fedora-init-crypto-1.service | 1 + systemd/system/fedora-init-crypto-2.service | 1 + systemd/system/fedora-init-crypto-3.service | 1 + 6 files changed, 17 insertions(+), 16 deletions(-) (limited to 'systemd') diff --git a/systemd/fedora-configure b/systemd/fedora-configure index 3a8c6dc4..63e6e4c7 100755 --- a/systemd/fedora-configure +++ b/systemd/fedora-configure @@ -4,22 +4,18 @@ . /etc/init.d/functions -if [ -f /.unconfigured ]; then - if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then - /usr/bin/rhgb-client --quit - fi +if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then + /usr/bin/rhgb-client --quit +fi - if [ -x /usr/sbin/firstboot ]; then - /usr/sbin/firstboot - fi - - # Reread in network configuration data. - if [ -f /etc/sysconfig/network ]; then - . /etc/sysconfig/network +if [ -x /usr/sbin/firstboot ]; then + /usr/sbin/firstboot +fi - # Reset the hostname. - action $"Resetting hostname ${HOSTNAME}: " hostname ${HOSTNAME} - fi +# Reread in network configuration data. +if [ -f /etc/sysconfig/network ]; then + . /etc/sysconfig/network - rm -f /.unconfigured + # Reset the hostname. + action $"Resetting hostname ${HOSTNAME}: " hostname ${HOSTNAME} fi diff --git a/systemd/fedora-init-crypto b/systemd/fedora-init-crypto index 1f707aec..79d18beb 100755 --- a/systemd/fedora-init-crypto +++ b/systemd/fedora-init-crypto @@ -2,4 +2,4 @@ . /etc/init.d/functions -[ -f /etc/crypttab ] && init_crypto $1 || : +init_crypto $1 || : diff --git a/systemd/system/fedora-configure.service b/systemd/system/fedora-configure.service index 032e94ae..fcaa5348 100644 --- a/systemd/system/fedora-configure.service +++ b/systemd/system/fedora-configure.service @@ -4,9 +4,11 @@ DefaultDependencies=no Conflicts=multi-user.target shutdown.target Before=multi-user.target shutdown.target After=local-fs.target +ConditionPathExists=/.unconfigured [Service] ExecStart=/lib/systemd/fedora-configure +ExecStopPost=rm -f /.unconfigured Type=oneshot TimeoutSec=0 StandardInput=tty diff --git a/systemd/system/fedora-init-crypto-1.service b/systemd/system/fedora-init-crypto-1.service index fee6bcce..6d6b732f 100644 --- a/systemd/system/fedora-init-crypto-1.service +++ b/systemd/system/fedora-init-crypto-1.service @@ -5,6 +5,7 @@ Conflicts=shutdown.target Before=shutdown.target emergency.service emergency.target After=fedora-wait-storage.service Requires=fedora-wait-storage.service +ConditionPathExists=/etc/crypttab [Service] ExecStart=/lib/systemd/fedora-init-crypto 0 diff --git a/systemd/system/fedora-init-crypto-2.service b/systemd/system/fedora-init-crypto-2.service index 2fc128eb..c01bbd1b 100644 --- a/systemd/system/fedora-init-crypto-2.service +++ b/systemd/system/fedora-init-crypto-2.service @@ -5,6 +5,7 @@ Conflicts=shutdown.target Before=shutdown.target emergency.service emergency.target After=fedora-storage-init.service Requires=fedora-storage-init.service +ConditionPathExists=/etc/crypttab [Service] ExecStart=/lib/systemd/fedora-init-crypto 0 diff --git a/systemd/system/fedora-init-crypto-3.service b/systemd/system/fedora-init-crypto-3.service index 08d3bf96..84b11fd5 100644 --- a/systemd/system/fedora-init-crypto-3.service +++ b/systemd/system/fedora-init-crypto-3.service @@ -5,6 +5,7 @@ Conflicts=shutdown.target Before=shutdown.target emergency.service emergency.target After=systemd-random-seed-load.service Requires=systemd-random-seed-load.service +ConditionPathExists=/etc/crypttab [Service] ExecStart=/lib/systemd/fedora-init-crypto 1 -- cgit v1.2.1