remove rtorrent.lock via php script

simur612

Member
May 25, 2018
879
0
16
Hey guys, im wondering if someone could help me, im currently using a php script so i can call on my stop/start/restart init files for rtorrent, im wondering if someone could help me in implementing a remove lock function into my php script which would, when working correctly - stop rtorrent, remove lock file, start rtorrent. any help would be greatly appreciated, thanks!
 

randac56

Member
May 25, 2018
915
0
16
You can either add a call to the PHP script to rm it (but you might need to add extra permissions to sudoers) or edit the init script that your PHP already has permissions to execute.
Post your PHP and/or your init script
 

simur612

Member
May 25, 2018
879
0
16
im using autodlirssi on my server so im calling that init via php with:

<?php
$comout = shell_exec('sudo /etc/init.d/autodl_user stop');
$comout = shell_exec('sudo /etc/init.d/autodl_user start');
echo "$comout
";
?>

its possible what I tried was just a fail on my part, but i do have extra permissions already added for www-data in my sudo to call this script above.
 

randac56

Member
May 25, 2018
915
0
16
Either add sudo perms for rm and run in the same manner or edit autodl_user to rm -f /path/to/rtorrent.lock in the startIt function.
 

simur612

Member
May 25, 2018
879
0
16
thanks a bunch kolor i think ive got it working now, ill post my edits here in more detail soon so others can do the same thing if needed smiley.gif