I would also like to see this functionality. Very simple to implement and would make things much easier for me. <p>nick.>Before the official release of icecast2 1.0 (non beta) i would like to see >pid file management, >ive discussed this before on how to capture the pid, but ended up with alot >of bash rigamaroo that mounted to even more >headaches. > >something in the config file like ><pid>/path/to/icecast.pid</pid> > >I would be willing to donate some bandwidth to xiph, to aleaviate this issue >that causes sever ps -ef | grep trauma ;) > >Thanks in advance for any and all considereation > > > >Dave St John >Mediacast1 Administration > > >--- >8 ---- >List archives: http://www.xiph.org/archives/ >icecast project homepage: http://www.icecast.org/ >To unsubscribe from this list, send a message to >'icecast-dev-request@xiph.org' >containing only the word 'unsubscribe' in the body. No subject is needed. >Unsubscribe messages sent to the list will be ignored/filtered.--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Dave St John wrote:> Before the official release of icecast2 1.0 (non beta) i would like to see > pid file management, > ive discussed this before on how to capture the pid, but ended up with alot > of bash rigamaroo that mounted to even more > headaches.If I understand you correctly, all you want is the PID of the Icecast process and not of its children (probably to be able to script, send signals to the right process, etc.) Well, I'm using OpenBSD mostly, and there's no "pidof" or "killall" here ... if I need to script something, I use the following which can be considered ``safe''. (The function is what's doing the job, the rest is just how I use it stand-alone sometimes). Simple, but effective - no insane greppery, no conflicts with additional `ps` output, nor pidof having any problems with itself (it can never have a PPID of 1, so it won't return its own PID, ever). --- snip --- #!/bin/sh # pidof() code by Christoph Moench-Tegeder # and Michael Erdely (from tech@openbsd.org) # _pidof() { ps -acxo pid,ppid,command | \ awk "\$3==\"$1\" && \$2==\"1\" {print \$1}" } if [ $# -ne 1 ] ; then cat << _EOF Usage: $0 <daemon_name> $0 displays the PID of a process, if its parent PID is 1. $0 exits with the return code 0 if there is a PID to report, otherwise the return code is 1. _EOF exit 0 fi _PID="`_pidof $1`" test ${_PID} && echo "${_PID}" || exit 1 exit 0 --- snap --- In order for _pidof() to work with Icecast2, you have to let it become a daemon using the -b parameter, e.g. "icecast -b -c icecast.xml" PID files are quite useless junk on the harddisk in most cases... IMO they make only sense if you have to run a program in the foreground and send signals like SIGUSR1 to it (those that don't have hotkeys like CTRL+C). Besides, they come with their own set of potential problems. Anyways - Icecast2 is very likely to get optional PID file support some time, but here's already a neat solution today. :) <p>Moritz --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Before the official release of icecast2 1.0 (non beta) i would like to see pid file management, ive discussed this before on how to capture the pid, but ended up with alot of bash rigamaroo that mounted to even more headaches. omething in the config file like <pid>/path/to/icecast.pid</pid> I would be willing to donate some bandwidth to xiph, to aleaviate this issue that causes sever ps -ef | grep trauma ;) Thanks in advance for any and all considereation <p><p>Dave St John Mediacast1 Administration <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Thanks for the snippet, albeit id still like to see it added :)> PID files are quite useless junk on the harddisk in most cases... IMO > they make only sense if you have to run a program in the foreground and > send signals like SIGUSR1 to it (those that don't have hotkeys like > CTRL+C). Besides, they come with their own set of potential problems. > Anyways - Icecast2 is very likely to get optional PID file support someYeah i agree. they are useless in way, but in terms of managing 100's of config files in a hosting environment, it can get to be a major pain. Eventualy ill commit my icecast admin #!/bin/bash source to cvs.casterclub.com for everyone else to use, just needs some final touches. <p><p>Dave St John Mediacast1 Administration ----- Original Message ----- From: <gtgbr@gmx.net> To: <icecast-dev@xiph.org> Sent: Monday, December 01, 2003 3:34 PM Subject: Re: REQ: [icecast-dev] Parent Id <p>> Dave St John wrote:> > Before the official release of icecast2 1.0 (non beta) i would like tosee> > pid file management, > > ive discussed this before on how to capture the pid, but ended up withalot> > of bash rigamaroo that mounted to even more > > headaches. > > If I understand you correctly, all you want is the PID of the Icecast > process and not of its children (probably to be able to script, send > signals to the right process, etc.) > > Well, I'm using OpenBSD mostly, and there's no "pidof" or "killall" here > ... if I need to script something, I use the following which can be > considered ``safe''. (The function is what's doing the job, the rest is > just how I use it stand-alone sometimes). Simple, but effective - no > insane greppery, no conflicts with additional `ps` output, nor pidof > having any problems with itself (it can never have a PPID of 1, so it > won't return its own PID, ever). > > --- snip --- > #!/bin/sh > > # pidof() code by Christoph Moench-Tegeder > # and Michael Erdely (from tech@openbsd.org) > # > _pidof() > { > ps -acxo pid,ppid,command | \ > awk "\$3==\"$1\" && \$2==\"1\" {print \$1}" > } > > if [ $# -ne 1 ] ; then > cat << _EOF > Usage: $0 <daemon_name> > > $0 displays the PID of a process, > if its parent PID is 1. > > $0 exits with the return code 0 > if there is a PID to report, > otherwise the return code is 1. > _EOF > exit 0 > fi > > _PID="`_pidof $1`" > test ${_PID} && echo "${_PID}" || exit 1 > exit 0 > --- snap --- > > In order for _pidof() to work with Icecast2, you have to let it become a > daemon using the -b parameter, e.g. "icecast -b -c icecast.xml" > > PID files are quite useless junk on the harddisk in most cases... IMO > they make only sense if you have to run a program in the foreground and > send signals like SIGUSR1 to it (those that don't have hotkeys like > CTRL+C). Besides, they come with their own set of potential problems. > Anyways - Icecast2 is very likely to get optional PID file support some > time, but here's already a neat solution today. :) > > > Moritz > --- >8 ---- > List archives: http://www.xiph.org/archives/ > icecast project homepage: http://www.icecast.org/ > To unsubscribe from this list, send a message to'icecast-dev-request@xiph.org'> containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered.<p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
http://cvs.casterclub.com/horde/chora/cvs.php?login=2 look for icecast_admin set of bash scripts for maintaining multiple accounts for icecast in a hosting environment. includes account created based on domain name etc.... <p><p>If anyone would like to contribute or provide updates etc... please let me know. <p><p><p><p>Dave St John Mediacast1 Administration ----- Original Message ----- From: <gtgbr@gmx.net> To: <icecast-dev@xiph.org> Sent: Monday, December 01, 2003 3:34 PM Subject: Re: REQ: [icecast-dev] Parent Id <p>> Dave St John wrote:> > Before the official release of icecast2 1.0 (non beta) i would like tosee> > pid file management, > > ive discussed this before on how to capture the pid, but ended up withalot> > of bash rigamaroo that mounted to even more > > headaches. > > If I understand you correctly, all you want is the PID of the Icecast > process and not of its children (probably to be able to script, send > signals to the right process, etc.) > > Well, I'm using OpenBSD mostly, and there's no "pidof" or "killall" here > ... if I need to script something, I use the following which can be > considered ``safe''. (The function is what's doing the job, the rest is > just how I use it stand-alone sometimes). Simple, but effective - no > insane greppery, no conflicts with additional `ps` output, nor pidof > having any problems with itself (it can never have a PPID of 1, so it > won't return its own PID, ever). > > --- snip --- > #!/bin/sh > > # pidof() code by Christoph Moench-Tegeder > # and Michael Erdely (from tech@openbsd.org) > # > _pidof() > { > ps -acxo pid,ppid,command | \ > awk "\$3==\"$1\" && \$2==\"1\" {print \$1}" > } > > if [ $# -ne 1 ] ; then > cat << _EOF > Usage: $0 <daemon_name> > > $0 displays the PID of a process, > if its parent PID is 1. > > $0 exits with the return code 0 > if there is a PID to report, > otherwise the return code is 1. > _EOF > exit 0 > fi > > _PID="`_pidof $1`" > test ${_PID} && echo "${_PID}" || exit 1 > exit 0 > --- snap --- > > In order for _pidof() to work with Icecast2, you have to let it become a > daemon using the -b parameter, e.g. "icecast -b -c icecast.xml" > > PID files are quite useless junk on the harddisk in most cases... IMO > they make only sense if you have to run a program in the foreground and > send signals like SIGUSR1 to it (those that don't have hotkeys like > CTRL+C). Besides, they come with their own set of potential problems. > Anyways - Icecast2 is very likely to get optional PID file support some > time, but here's already a neat solution today. :) > > > Moritz > --- >8 ---- > List archives: http://www.xiph.org/archives/ > icecast project homepage: http://www.icecast.org/ > To unsubscribe from this list, send a message to'icecast-dev-request@xiph.org'> containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered.<p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.