![]() |
screen & rtorrent init.d start
Hi
I have recently setup rtorrent to run on my Ubuntu server. I have set it up to automatically start on boot which is now working fine. rtorrent runs in screen and this all boots up and starts 100% as I want it to. The problem is when I for example make some changes to the config file and want to restart the service When I run the command Code:
/etc/init.d/rtorrentInit stopThe problem is trying to restart it. If I run Code:
/etc/init.d/rtorrentInit startI then have to reboot the server for screen and rtorrent to start again as they do automatically on boot Now I am sure you can see how this can be a problem as it is a server and I really do not need to be restarting my it every 5 minutes while making changes Your help is much anticipated and will be much appreciated Thanks G |
Quote:
|
also try and reattach the screen and see if there is any messages there:
Code:
screen -lsCode:
screen -rAt a guess your stop script is stopping rtorrent but not terminating the screen. Then when you try to start it again it fails because there is already a screen of that name. |
Hi
Thanks for the reply. Been at work and unable to reply OK, so here is the script file from init.d Code:
#!/bin/shThanks again! G |
Mephisto
You could be right. If that is the case? How do I get the stop command to kill both. I am not 100% sure if this is the case and I am unable to test it at this stage as I can't risk needed to reboot. Should have a chance tomorrow. In the mean time any suggestions on the script I posted and how I could get them both to stop if this is the case would be much appreciated Thanks G |
Well based on the script it looks like it reuses the screen if it exists so you should be fine there. I would need to install rtorrent to try and decipher the problem, I will try tomorrow night on a VM. Sorry I can not be faster, but I did not bring my VMs with me tonight and do not want to install rtorrent on my main laptop.
Anyway a few notes: - the init script does use a named screen (srntorrent) running as the user torrnt - init logs are located at /var/log/rtorrentInit.log First things first, when you start and stop the rtorrent do you use Code:
/etc/init.d/rtorrentInit start|stopCode:
sudo/etc/init.d/rtorrentInit start|stopIf you are using sudo try: Code:
tail -n20 /var/log/rtorrentInit.logyou could try Code:
screen -r srntorrent |
Hi Mephisto
I had a look in the log files but there is nothing useful in there. In fact I think there is nothing in their since I first starting setting this up and had some permission problems accessing the .rtorrent.rc file. I will get a snap of this later anyway to make sure. Quote:
I have also checked to make sure that they are no longer running using ps -ef | grep torrent This actually shows if either rtorrent or the screen (srntorrent) are running I believe (will confirm tonight) both are killed with the command Code:
sudo /etc/init.d/rtorrentInit stop |
Hi
Ahh OK... When I use the command Code:
sudo /etc/init.d/rtorrentInit stopCode:
sudo /etc/init.d/rtorrentInit startThink I may have been using the kill command to end screen as well thinking I needed to and expecting the init script to create a new screen session. So why is it that I cannot start it if I kill of screen. Should it not just create a new one? Thanks G |
Try
Code:
/etc/init.d/rtorrentInit stop |
| All times are GMT -5. The time now is 06:04 PM. |