LinHES Forums
http://forums.linhes.org/

Arch vs LinHes re: starting daemons
http://forums.linhes.org/viewtopic.php?f=21&t=20961
Page 1 of 1

Author:  jzigmyth [ Wed Mar 31, 2010 11:29 am ]
Post subject:  Arch vs LinHes re: starting daemons

I want to install ncid so I can have caller ID displayed on the tv while watching Myth recordings. So to get the procedure down, I installed plain Arch on a test machine. No myth stuff, just Arch. I downloaded the ncid source and did the make and make install (actually for Arch I used "make package" and "make package-install" as per instructions in the makefile).

I got the ncid server working and to have the daemon start on boot I added "ncidd" in the daemons section in rc.conf as per the Arch wiki. Works fine and starts up on boot.

Then I went to my test linhes (6.02) machine and did the same thing (make and make install). I can start the daemon manually by just typing ncidd at the command line and it works. But putting it in the daemons section of rc.conf does not work. It doesn't start on boot.

There isn't much in the daemons section of rc.conf on LinHes. It seems daemons are started some other way.

So my question is, why doesn't what works on Arch not work in 6.02? And how can I get the daemons to start on boot in 6.02? Am I missing something obvious or does it get complicated from here on in?

Thanks.

Author:  brfransen [ Wed Mar 31, 2010 11:54 am ]
Post subject: 

LinHES uses runit instead of sysv init. See http://linhes.org/bugs/projects/linhes/ ... n-Settings

Author:  jzigmyth [ Thu Apr 01, 2010 9:49 am ]
Post subject: 

Thanks for the pointer!
I created the service directory /etc/sv/ncidd and put an executable run file in it:
Code:
#!/bin/sh
exec 2>&1
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions

stat_runit "Starting CallerID"
   
exec /usr/sbin/ncidd 2>&1
Then I added the service:
Code:
# add_service.sh ncidd
Then I started the service with sv and this is what I get:
Code:
# sv start ncidd
timeout: down: ncidd: 1s, normally up, want up
#
I'm not sure how to debug this. Starting the daemon from the command line works.
Code:
#ncidd

Author:  jzigmyth [ Thu Apr 01, 2010 10:11 am ]
Post subject: 

From the runit website:
Quote:
Note that for the use with runit, service daemons must not put themself into the background, but must run in the foreground.
Perhaps this is the problem? I think ncidd puts itself into the background when it executes, because the command prompt returns when executing it from the command line.

Looking at the ncidd docs, there is no command line argument for disabling running in the background.

Is there an alternate method to get this daemon running at boot time with LinHes without using runit?

Author:  brfransen [ Thu Apr 01, 2010 11:30 am ]
Post subject: 

Did you try using the debug (-D) option? That may keep it in the foreground. If it doesn't you could start it from /etc/runit/1.local

Also, if you get this working please add how you did it to the Wiki: http://linhes.org/bugs/projects/linhes/ ... eat_things

Britney

Author:  mihanson [ Thu Apr 01, 2010 11:35 am ]
Post subject: 

jzigmyth wrote:
From the runit website:
Quote:
Note that for the use with runit, service daemons must not put themself into the background, but must run in the foreground.
Perhaps this is the problem?


Probably. Is there a "debug" option? That sometimes keeps the app in the foreground.

Quote:
Is there an alternate method to get this daemon running at boot time with LinHes without using runit?


If there is no debug option I have an idea . . . maybe.

Author:  jzigmyth [ Thu Apr 01, 2010 12:32 pm ]
Post subject: 

Yes, there is a debug ( -D) option, and yes, that does seem to keep it in the foreground. However, I still get the same timeout error from sv start.

On the brighter side, putting it in /etc/runit/1.local does work! But don't put it there with the debug option turned on. That locked up the boot process!

There must be something wrong with my sv run script. I just kludged it from looking at other scripts. I don't really know what everything in there does.

Any ideas on how to start it with runit's sv command are welcome. For now it's working from /etc/runit/1.local so I'll continue along that path to see if I can get it all working on my test machine.

Thanks, again!

Author:  paulsid [ Thu Apr 01, 2010 1:16 pm ]
Post subject: 

If you can't find a way to make the daemon run in the foreground, you can fake it by scripting a wait in the run script. Search for my MythExport how-to post for an example.

Author:  mihanson [ Thu Apr 01, 2010 3:33 pm ]
Post subject: 

jzigmyth wrote:
There must be something wrong with my sv run script. I just kludged it from looking at other scripts. I don't really know what everything in there does.


Code:
cd /etc/sv/<servicename>
./run


Note that's <dot><slash>run (Hard to see)

What does it say? (If anything)

Author:  jzigmyth [ Thu Apr 01, 2010 4:06 pm ]
Post subject: 

mihanson wrote:
What does it say? (If anything)
Well, I'm embarrassed to admit it crashed out because I have windows line-feeds in the file! I was using webmin to cut and paste and edit files and somehow I introduced windows line-feeds into the run file.

After fixing the file, the daemon started properly through sv start. We're cooking with gas, now!

This looks very promising, I'll update the wiki as soon as I get the finishing touches on this.

Thanks Britney and Mihanson for your debugging help and Paulsid for your alternate solutions.

Author:  jzigmyth [ Sat Apr 03, 2010 7:27 am ]
Post subject: 

brfransen wrote:
Also, if you get this working please add how you did it to the Wiki: http://linhes.org/bugs/projects/linhes/ ... eat_things
Well, it looks like I'm gonna need some help with the wiki, too! I went to the above link, and I can't see any way to start a new topic, or edit an old one for that matter.

I have worked on the knoppmyth wiki, but I can't figure out the LinHES wiki. I am signed in, but I don't see an "edit" button.
:?:

Author:  brfransen [ Sat Apr 03, 2010 11:29 am ]
Post subject: 

jzigmyth, try it now.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/