sys-devel/prelink: ignore warnings from 'ldd /sbin/init'
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 23 Aug 2019 06:48:10 +0000 (07:48 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Fri, 23 Aug 2019 06:49:01 +0000 (07:49 +0100)
/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>
sys-devel/prelink/files/prelink.cron

index a3edc429fee7eeb86fd2518b103378bd54d11ed1..067fc2ea97a2018fe500174383189f870ca19a19 100644 (file)
@@ -55,7 +55,7 @@ fi
 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