/sbin/init might not exist at all. Let's not generate
text output in this case.
Reported-by: Anthony Parsons
Closes: https://bugs.gentoo.org/678348
Package-Manager: Portage-2.3.72, Repoman-2.3.17
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
echo /usr/sbin/prelink -av $PRELINK_OPTS > ${log}
/usr/sbin/prelink -av $PRELINK_OPTS >> ${log} 2>&1 \
|| echo Prelink failed with return value $? >> ${log}
-# Restart init if needed
-[ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+# Restart init if needed (and if exists)
+[ -n "$(find `ldd /sbin/init 2>/dev/null | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
exit 0