Parcourir la source

[master] keatctrl status can be run as non-root user

Merges branch 'trac3954'
Thomas Markwalder il y a 9 ans
Parent
commit
f7f22b2443
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/bin/keactrl/keactrl.in

+ 2 - 2
src/bin/keactrl/keactrl.in

@@ -111,8 +111,8 @@ check_running() {
     # Get the PID from the PID file (if it exists)
     get_pid_from_file ${proc_name}
     if [ ${_pid} -gt 0 ]; then
-        # Use kill -0 to check if PID is alive
-        kill -0 ${_pid}
+        # Use ps to check if PID is alive
+        ps -p ${_pid} 1>/dev/null
         if [ $? -eq 0 ]; then
             # No error, so PID IS ALIVE
             _running=1