Reboot
Aus Programmers Guide
(Unterschied zwischen Versionen)
Roy (Diskussion | Beiträge)
(Die Seite wurde neu angelegt: „= Server mit PHP neu starten = ==== Der PHP-Teil ==== <source lang="php"> function shellExec($command){ $output = shell_exec($command); return $output; } f…“)
(Die Seite wurde neu angelegt: „= Server mit PHP neu starten = ==== Der PHP-Teil ==== <source lang="php"> function shellExec($command){ $output = shell_exec($command); return $output; } f…“)
Aktuelle Version vom 18:00, 6. Sep. 2010
Inhaltsverzeichnis |
Server mit PHP neu starten
Der PHP-Teil
function shellExec($command){ $output = shell_exec($command); return $output; } function rebootServer(){ shellExec("touch /var/lock/reboot.lock"); return "Das System wird in der nächsten Minute neu gestartet..."; }
Der Shell-Teil
sudo vim /etc/ownsystem/reboot #insert #-------------------------start------------------------ #!/bin/bash if [ -f /var/lock/reboot.lock ] then rm /var/lock/reboot.lock if [ ! -f /var/lock/reboot.lock ] then reboot now fi fi exit 0 #--------------------------stop------------------------ #:wq for save and quit
Der Crontab-Teil
crontab -e #insert */1 * * * * root /etc/ownsystem/reboot > /dev/null 2>&1