You are not logged in.

#1 2007-04-15 03:46:12

Xarathur
Member
From: Venezuela
Registered: 2007-03-25
Posts: 16
Website

Creating a Daemon for Ices2

Hello. I'm trying to create a init script for Ices2. I took the Icecast one and modified a little bit , but when I try to start the daemon, the stat stays on BUSY, like this:

{phantom} [~]$ sudo /etc/rc.d/ices start
Password:
:: Starting Ices2 Daemon                                                 [BUSY]

Ices actually starts, but the prompt remains frozen in BUSY. Shouldn't it say DONE and return to the prompt like any other init script?

This is the modified script:

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/ices`
case "$1" in
  start)
    stat_busy "Starting Ices2 Daemon"
    [ -z "$PID" ] && /usr/bin/ices /home/phantom/software/ices/config.xml &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      echo $PID > /var/run/ices.pid
      add_daemon ices
      stat_done
    fi
    ;;                        
  stop)
    stat_busy "Stopping Ices2 Daemon"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm /var/run/ices.pid
      rm_daemon ices
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

Thanks.

Offline

#2 2007-04-15 07:04:16

raymano
Member
Registered: 2006-10-13
Posts: 357
Website

Re: Creating a Daemon for Ices2

What happens if you issue

/usr/bin/ices /home/phantom/software/ices/config.xml

on the command line in a shell by itself. Does it return to the prompt or does it just sit there?


FaunOS: Live USB/DVD Linux Distro: http://www.faunos.com

Offline

#3 2007-04-15 15:52:21

Xarathur
Member
From: Venezuela
Registered: 2007-03-25
Posts: 16
Website

Re: Creating a Daemon for Ices2

Actually, it does the same, it sits there...:|

Offline

#4 2007-04-15 16:22:31

smoon
Member
Registered: 2005-08-22
Posts: 468
Website

Re: Creating a Daemon for Ices2

Is the background-setting set to 1 in your ices config file?

<background>1</background>

Last edited by smoon (2007-04-15 16:24:04)

Offline

#5 2007-04-15 17:05:07

Xarathur
Member
From: Venezuela
Registered: 2007-03-25
Posts: 16
Website

Re: Creating a Daemon for Ices2

Jeez, I knew it was something stupid. Thank you both, guys, doing what smoon said fixed the problem wink

Last edited by Xarathur (2007-04-15 17:32:20)

Offline

Board footer

Powered by FluxBB