Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
respawning esd with supervise
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
boglin
n00b
n00b


Joined: 07 Jun 2002
Posts: 67
Location: Kingston, ON

PostPosted: Thu Nov 25, 2004 3:03 am    Post subject: respawning esd with supervise Reply with quote

I am posting because I am certain this is not the optimal solution; I'm hoping that some experts around the forum can give me some tips....

I had a small problem using EsounD(esd) on a computer connected to me stereo. I wanted xmms on my other pcs to pipe to EsounD on the stereo computer, which it did; it's only that it would do it once, and then I would have to restart /etc/init.d/esound. Did a little searching on google and found that RedHat has some kind of problem that is similiar, in so much as the posts showed during my search.

Anywho: I decided to use the daemontools package's supervise to keep esd alive. so I made a /service/esd directory. and edited /services/esd/run:
Code:

#!/bin/bash
source /etc/conf.d/esound
/usr/bin/esd -- $ESD_START $ESD_OPTIONS


Made a new init-script: /etc/init.d/esd (instead of esound):
Code:

#!/sbin/runscript
depend() {
        use net portmap alsasound
}

start() {
        rm /service/esd/down
        ebegin "Starting es daemon"
        start-stop-daemon --start --quiet --background --exec /usr/bin/supervise -- /service/esd/
        eend $?
}

stop() {
        ebegin "Stopping es daemon"
        touch /service/esd/down
        /usr/bin/svc -kx /service/esd/
        kill $(pidof esd)
        eend $?
}


Pretty simple, right? The wierd thing is that the "kill $(pidof..." is neccessary or else there is always an esd process hanging around after "#/etc/init.d/esd stop". Same result when "exec fghack" is prepended to the line in "run".
I supposed I should mention that this does succefully respawn esd; so now I can change tracks in xmms locally w/o ssh'ing to the box to restart esound.

Thoughts? Comments? Suggestions?
Back to top
View user's profile Send private message
nx12
Apprentice
Apprentice


Joined: 14 Jan 2004
Posts: 193

PostPosted: Thu Jul 14, 2005 9:17 pm    Post subject: Reply with quote

Hmm, I've got the same problem, though I use a simple dirty
Code:

a=1; while [ $a ]; do esd  -d hw:0 -as 2; done


But I would be glad to know if someone solved this problem without hacks. Thanks in advance.
_________________
signature sucks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum