From 01931bd3a8b59aa1bab43460f29f3924e6b85a5b Mon Sep 17 00:00:00 2001 From: "epgrec@park.mda.or.jp" Date: Tue, 28 Feb 2012 17:14:49 +0900 Subject: [PATCH] =?utf8?q?modified:=20=20=20epgwakealarm.php=20=20=20=20?= =?utf8?q?=20=20=20=20=20=20=20=E8=8B=A5=E5=B9=B2=E4=BF=AE=E6=AD=A3=20modi?= =?utf8?q?fied:=20=20=20getepg.php=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?utf8?q?=20=20=20=20=E8=8B=A5=E5=B9=B2=E4=BF=AE=E6=AD=A3=20new=20file:?= =?utf8?q?=20=20=20sudoers.d/01=5Ffirst=20=20=20=20=20=20=20=20=20?= =?utf8?q?=E5=BF=85=E8=A6=81=E3=81=AAsudo=E3=81=AE=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- epgwakealarm.php | 3 ++- getepg.php | 4 ++++ sudoers.d/01_first | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 sudoers.d/01_first diff --git a/epgwakealarm.php b/epgwakealarm.php index 74ede90..7b56f34 100755 --- a/epgwakealarm.php +++ b/epgwakealarm.php @@ -31,13 +31,14 @@ } else if( (intval($wakeupvars->getepg_time) + intval($settings->getepg_timer) * 3600 ) <= time() ) { $wakeupvars->reason = "getepg"; - exec( INSTALL_PATH."/getepg.php" ); + exec( INSTALL_PATH."/getepg.php >/dev/null 2>&1" ); $wakeupvars->getepg_time = time(); } else { $wakeupvars->reason = "other"; } $wakeupvars->asXML(INSTALL_PATH. "/settings/wakeupvars.xml"); + chown(INSTALL_PATH. "/settings/wakeupvars.xml", 0666 ); } catch( Exception $e ) { // diff --git a/getepg.php b/getepg.php index 58432ac..674a476 100755 --- a/getepg.php +++ b/getepg.php @@ -24,6 +24,10 @@ if( pcntl_fork() != 0 ) exit; pcntl_signal(SIGTERM, "handler"); + + fclose(STDIN); + fclose(STDOUT); + fclose(STDERR); } function check_file( $file ) { diff --git a/sudoers.d/01_first b/sudoers.d/01_first new file mode 100755 index 0000000..c53dcce --- /dev/null +++ b/sudoers.d/01_first @@ -0,0 +1,2 @@ +www-data ALL=NOPASSWD: /sbin/shutdown +root ALL=(ALL:ALL) ALL -- 2.11.0