i have created subversion hook various things including sending out emails , updating working copy on server. when run bash propt works perfectly. when run through either tortoisesvn or netbeans on commit, emails etc sent update not executed, no errors appear either. file php file , using backtick method run bash commands. other bash commands run compose emails isn't issue.
here line should run update , log outcome. $location pulled database of working copy locations.
$update_output = `/usr/local/bin/svn update /home/$location >> update.log`;
thanks
james
edit, more complete script:
#!/usr/local/bin/php <? $repos = $argv[1]; $rev = $argv[2]; $output[] = `/usr/local/bin/svnlook dirs-changed -r $rev $repos`; foreach($output $line) { preg_match("$([^/]+)$", $line, $array); $projects[] = $array[0]; } $projects = array_unique($projects); $mysqli = new mysqli('localhost', 'svn_user', 'pringles', 'svn_maindb'); if ($mysqli->connect_error) { die('connect error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error); } foreach($projects $project) { $query = "select * project name = '$project' limit 1"; $result = $mysqli->query($query); $row = $result->fetch_assoc(); $proj_id = $row['id']; $location = $row['location']; if(!empty($location)) { $update_output = `/usr/local/bin/svn update /home/$location >> update.log`; } /* below line works when script run hand */ $test = `/usr/bin/lessecho test >> /home/svn/repo/hooks/update.log`; /* grab user db , call send_email user */ } function send_email($repos, $rev, $programmer, $email) { $author = `/usr/local/bin/svnlook author -r $rev $repos`; $message .= "project committed $author comments: "; $message .= `/usr/local/bin/svnlook log -r $rev $repos`; $message .= " ===========list of changes======== u = updated = added d = deleted "; $message .= `/usr/local/bin/svnlook changed -r $rev $repos`; /* compose , send email */ }
root 4231 0.0 0.0 61180 748 pts/0 s+ 17:09 0:00 grep svnserve
is because ran root? if running root there should no permissions issue?
Comments
Post a Comment