cc-2055: switch to init.d

-need to verify is pid from pid file actually is running
 (for airtime-check-system)
This commit is contained in:
martin 2011-06-02 11:09:49 -04:00
parent 963351c6f2
commit bfb5dc4e58
2 changed files with 26 additions and 15 deletions

View File

@ -63,6 +63,9 @@ if (!$version){
echo "******************************** Update Begin *********************************".PHP_EOL;
//convert strings like 1.9.0-devel to 1.9.0
$version = substr($version, 0, 5);
if (strcmp($version, "1.7.0") < 0){
system("php ".__DIR__."/upgrades/airtime-1.7/airtime-upgrade.php");
}
@ -83,7 +86,7 @@ if (strcmp($version, "1.9.0") < 0){
//set the new version in the database.
$sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'";
$CC_DBC->query($sql);
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '1.8.2')";
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '1.9.0-devel')";
$CC_DBC->query($sql);

View File

@ -87,8 +87,11 @@ class AirtimeCheck {
if (file_exists($filename)){
//first get pid
$pid = trim(file_get_contents($filename));
$potential_pid = trim(file_get_contents($filename));
//check if the pid is actually live
if (file_exists("/proc/$potential_pid")){
$pid = $potential_pid;
//now lets get the running time
$lastModified = filemtime($filename);
@ -96,6 +99,7 @@ class AirtimeCheck {
$numSecondsRunning = $currentTime - $lastModified;
}
}
output_status("PLAYOUT_ENGINE_PROCESS_ID", $pid);
@ -126,8 +130,11 @@ class AirtimeCheck {
if (file_exists($filename)){
//first get pid
$pid = trim(file_get_contents($filename));
$potential_pid = trim(file_get_contents($filename));
//check if the pid is actually live
if (file_exists("/proc/$potential_pid")){
$pid = $potential_pid;
//now lets get the running time
$lastModified = filemtime($filename);
@ -135,6 +142,7 @@ class AirtimeCheck {
$numSecondsRunning = $currentTime - $lastModified;
}
}
output_status("LIQUIDSOAP_PROCESS_ID", $pid);