]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-logger.sh: check is journald.socket is active
authorHarald Hoyer <harald@redhat.com>
Wed, 28 Aug 2013 18:01:54 +0000 (20:01 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 28 Aug 2013 18:01:54 +0000 (20:01 +0200)
before using systemd-cat, make sure someone is listening

dracut-logger.sh

index 0c505e290097bcbe6ecb764e6f756f1df2aa5f85..b052581e8234899a0094c3e37d20a6be054d59cd 100755 (executable)
@@ -141,7 +141,10 @@ dlog_init() {
     fi
 
     if (( $sysloglvl > 0 )); then
-        if [[ -d /run/systemd/journal ]] && type -P systemd-cat &>/dev/null && (( $UID  == 0 )) ; then
+        if [[ -d /run/systemd/journal ]] \
+            && type -P systemd-cat &>/dev/null \
+            && (( $UID  == 0 )) \
+            && systemctl is-active systemd-journald.socket  &>/dev/null; then
             readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)"
             readonly _systemdcatfile="$_dlogdir/systemd-cat"
             mkfifo "$_systemdcatfile"