diff options
Diffstat (limited to 'backend/backend.php')
-rwxr-xr-x | backend/backend.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/backend.php b/backend/backend.php index 5d5fb6b..3cd0f07 100755 --- a/backend/backend.php +++ b/backend/backend.php @@ -41,7 +41,7 @@ if (is_file($pidfile)) { die("Found already running backend PID=$pid.\n"); } if (posix_geteuid() !== 0) - debug(STDERR, "Not running as root... this is not going to accomplish much."); + debug("Not running as root... this is not going to accomplish much."); if (file_put_contents($pidfile, posix_getpid())) $unlinkpidfile=true; require_once(SHARED.'/include/dbinit.php'); @@ -60,12 +60,15 @@ while (true) { } catch (Exception $e) { log_msg('Caught exception: '.$e->getMessage()); $build->status='finished/failed: '.$e->getMessage(); + $owner=$build->get_owner(); + xhtmlemail('"'.$owner->name.'" <'.$owner->email.'>', null, $conf['title'].' build failed', 'Your build has failed. You can find more information at <a href="'.url('logs/'.$build->id).'">'.url('logs/'.$build->id).'</a>'); } $build->finish=time(); log_msg('Finished with build id='.$build->id); if (isset($image)) { log_msg("Completed image at $image"); $build->status='finished/success'; + xhtmlemail('"'.$owner->name.'" <'.$owner->email.'>', null, $conf['title'].' build finished', 'Your build has completed successfully. You can find more information and download the completed image at <a href="'.url('logs/'.$build->id).'">'.url('logs/'.$build->id).'</a>'); } $build->write(); unset($build); |