Screen and dtach sessions show as main in process manager
|
9th Jun, 2014, 06:56 AM
Post: #1
|
|||
|
|||
Screen and dtach sessions show as main in process manager
Hi,
Every time when I try to start my daemon start-stop-daemon --chuid $USER --start --name $NAME --nicelevel $NICE --background --pidfile $PID_FILE --make-pidfile --exec /usr/bin/dtach -- -n $TMP /usr/local/bin/rtorrent -n -o import=$CONFIG_FILE My pid file is showing process that don't exist and this process is showed in top as main. What can be a cause of this? I'm trying to make package for xbian but can't make proper stop script for this, and can't kill the process Here's my current init.d file: https://github.com/koper89/xbian-rtorrent/blob/master/content/etc/init.d/rtorrent if you want to test my rtorrent package: https://github.com/koper89/xbian-rtorrent |
|||
9th Jun, 2014, 07:10 AM
Post: #2
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
Don't create init.d scripts but rather use upstart ones. Check the /etc/init/ folder for examples.
pilight - modular domotica solution
|
|||
9th Jun, 2014, 07:15 AM
Post: #3
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
Ok, I'll check those, and maybe you have any suggestions about using screen dtach t-mux? I wanted to make it as lightweight as I could that's why I choose dtach but maybe you'll have some suggestions and prefer screen t-mux?
But i suppouse upstart will not solve "main" problem |
|||
9th Jun, 2014, 07:57 PM
Post: #4
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
Sorry to double post but I suppouse I need more explanation here:
1. I tried on upstart and init.d script 2. Every time I start my dtach or screen session it start as f.e. rtorrent and PID 12100 and after few seconds it changes to main and PID 12101 and I can't stop my process because it's no longer recognized by my script 3. I tried on screen and dtach What can be a cause of this |
|||
10th Jun, 2014, 05:25 AM
Post: #5
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
it's just a idea,
as i don't know so much about upstart, but look at this http://upstart.ubuntu.com/cookbook/#expect Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here |
|||
10th Jun, 2014, 07:23 AM
Post: #6
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
But it's not a problem in upstart, it's general problem in using screen or dtach in xbian since RC2 i suppouse, I have always change PID and name of the process to main..
|
|||
10th Jun, 2014, 07:25 AM
Post: #7
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
Why are you using both programs in the first place? Just start rtorrent directly in your upstart script.
Simple example from pilight: Code: #!upstart pilight - modular domotica solution
|
|||
10th Jun, 2014, 08:05 AM
Post: #8
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
I said I checked it on both of them not using both at a time.
Rtorrent doesn't have a daemon so i suppouse screen or dtach is a must, but maybe I don't understand how upstart works.... And I found what was the cause of my problem it was not screen/upstart/init.d it's propably a bug in rtorrent 0.9.4 when i downgraded to 0.9.3 it's solved and it shows properly rtorrent not main I'll make 3 packages for xbian with rtorrent 0.9.2 (because some trackers don't allow 0.9.3) rtorrent 0.9.3 and dev with 0.9.4 (it's marked as stable but I found that it have a lot of memory leaks which is really visible on raspberry Pi) And should I compile nginx and other dependancies and include them in package, or marking them as dependancies will do the work, as I currently do? Btw. I have also a question about sickbeard-tpb package, (maybe i shouldn't post it here) But why should I add current files of f.e. sickbeard in xbian package, and not use git clone in post install to always get newest version ? Best wishes |
|||
10th Jun, 2014, 05:47 PM
Post: #9
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
If you'd actually tried my suggestion, you would have noticed that it was the right way to go It doesn't matter to upstart if something daemonizes or not, as long as you configure your upstart script correctly.
Proof of concept Code: cat <<\EOF > /root/test.sh Just copy and paste everything between the code tags at once in your terminal. Then try: Code: service test start However, if you do this in your upstart script Code: exec /root/test.sh & Code: expect fork pilight - modular domotica solution
|
|||
10th Jun, 2014, 06:36 PM
Post: #10
|
|||
|
|||
RE: Screen and dtach sessions show as main in process manager
I think you're not right, I tested your script (and without dtach or screen it's not working). Don't know why exactly but never find rtorrent running without screen/dtach/tmux.
|
|||
« Next Oldest | Next Newest »
|