dsa-is-shutdown-scheduled: rewrite the systemd-shutdownd test using pgrep
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 12 Aug 2017 15:52:00 +0000 (17:52 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 12 Aug 2017 15:52:00 +0000 (17:52 +0200)
Otherwise we end up detecting the command started by dsa-is-shutdown-scheduled
when the script is launched twice or more at the same time.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
modules/debian_org/files/dsa-is-shutdown-scheduled

index c23f2f2..4dd1a7f 100644 (file)
@@ -5,7 +5,7 @@ if /usr/lib/nagios/plugins/check_procs -w 1: -u root -C shutdown > /dev/null; th
        exit 0
 fi
 # jessie
-if /usr/lib/nagios/plugins/check_procs -w 1: -u root -a /lib/systemd/systemd-shutdownd > /dev/null; then
+if pgrep -u root -fx /lib/systemd/systemd-shutdownd > /dev/null; then
        exit 0
 fi
 # stretch