You are not logged in.

#1 2007-02-07 00:44:08

Xarturkhann
Member
From: Ankara
Registered: 2006-02-17
Posts: 55

Some advice and help needed for rc script.

While this program is active, it is monitoring some data output. When i run this rc script it doesn't drop to console. It shows busy all the time.(it is writing "BUSY" but the program is working properly.)

[root@arch ozgur]# /etc/rc.d/sascd start
:: Starting SASC-NG                                                      [BUSY]

Because of this, it freezes in the boot process.
I am trying to drop to console without monitoring.

I tried this conbinations:
[ -z "$PID" ] && /usr/bin/sasc-ng $SASCOPTION &
[ -z "$PID" ] && /usr/bin/sasc-ng $SASCOPTION & || return 1
[ -z "$PID" ] && /usr/bin/sasc-ng $SASCOPTION &> /dev/null 2>&1
[ -z "$PID" ] && /usr/bin/sasc-ng $SASCOPTION &> /dev/null
[ -z "$PID" ] && /usr/bin/sasc-ng $SASCOPTION &> /dev/null || return 1

But its not working. Anybody has any suggestions?

#!/bin/bash

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

PID=`pidof -o %PPID /usr/bin/sasc-ng`

[ -f /etc/sasc.conf ] && source /etc/sasc.conf

case "$1" in
  start)
    stat_busy "Starting SASC-NG"
    /sbin/modprobe dvbloopback $LOOPDRIVEROPTION
    sleep 2
    [ -z "$PID" ] && /usr/bin/sasc-ng $SASCOPTION &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      echo $PID > /var/run/sasc-ng.pid
      add_daemon sasc-ng
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping SASC-NG"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    rmmod dvbloopback &
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon sasc-ng
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
    ;;
esac
exit 0

Offline

#2 2007-02-07 21:22:08

Xarturkhann
Member
From: Ankara
Registered: 2006-02-17
Posts: 55

Re: Some advice and help needed for rc script.

Ok found it. This is what i need smile

[ -z "$PID" ] && /usr/bin/sasc-ng $SASCOPTION > /var/log/sascd 2>&1 &

Offline

#3 2007-02-07 22:16:06

F
Member
Registered: 2006-10-09
Posts: 322

Re: Some advice and help needed for rc script.

make sure to create a cron job to empty out /var/log/sascd every once in a while, though.

Offline

Board footer

Powered by FluxBB