[Icecast] Proper way to start multiple icecast services through bash script?

Philipp Schafft lion at lion.leolix.org
Mon May 29 15:27:22 UTC 2017


Good afternoon,


On Mon, 2017-05-29 at 17:35 +0300, Yahav Shasha wrote:
> try this:
> /usr/bin/icecast -c /etc/icecast.xml -b > /dev/null 2>&1 &
> as for killing them, don't overcomplicate things, killall icecast -KILL

You should never kill process with SIGKILL if not really, really needed.
Using SIGKILL will not give them a chance to clean up. E.g. no flushing
of logs, no telling clients (just connection resets), no cleanup of open
sockets (may result in stalled connections), no closing of databases
(for applications that use databases) or other backend services and
child processes.

Icecast2 perfectly handles SIGTERM.


> On Mon, May 29, 2017 at 5:27 PM, Walter York <walteryork at hotmail.com> wrote:
> >>>  #Kill all processes with the name icecast
> >>>  ps -ef | grep icecast | grep -v grep | awk '{print $2}' | xargs -r
> >>>  kill -9

use pkill here. That is portable. It has a lot options to select the
correct process.

Also avoid using signal numbers. they're not portable and bad style.
SIGTERM is the default for pkill.

with best regards,

-- 
Philipp.
 (Rah of PH2)


More information about the Icecast mailing list