Checking if process still running?

后端 未结 9 557
野的像风
野的像风 2020-11-30 03:55

As a way to build a poor-man\'s watchdog and make sure an application is restarted in case it crashes (until I figure out why), I need to write a PHP CLI script that will be

9条回答
  •  一整个雨季
    2020-11-30 04:41

    The main problem is the if you run a php script, the exec command will be run as the web-servers user (www-data); this user can't see pid's from other users, unless you use "pidof"

     1) {
                            echo "$string: RUNNING
    "; } else { echo "$string: DOWN
    "; } } } //Beispiel "Text zum anzeigen", "Prozess Name auf dem Server" server_status("Running With Rifles","rwr_server"); server_status("Starbound","starbound_server"); server_status("Minecraft","minecarf"); ?>

    More information about the script here http://umbru.ch/?p=328

提交回复
热议问题