| # Provides: dev_mgmt_daemon |
| # Required-Start: $local_fs $network $syslog |
| # Required-Stop: $network $local_fs $syslog |
| # Short-Description: Broadcom BAL core daemon |
| # Description: Broadcom BAL core daemon |
| PATH="/broadcom:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" |
| . /lib/lsb/init-functions |
| /opt/bcm68620/svk_init.sh |
| printf "Starting '$NAME'... " |
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$APPDIR |
| start-stop-daemon --verbose --start --chuid "$USER:$GROUP" --background --no-close --chdir "$APPDIR" --exec "$APPBIN" -- $APPARGS < /dev/tty1 >> /var/log/$NAME.log 2>&1 || true |
| sleep 2 && [ -z `pidof $NAME 2>/dev/null` ] || pidof $NAME > /var/run/$NAME.pid |
| #We need this function to ensure the whole process tree will be killed |
| for _child in $(ps -o pid --no-headers --ppid ${_pid}); do |
| killtree ${_child} ${_sig} |
| printf "Stopping '$NAME'... " |
| [ -z "`pidof $NAME`" ] || |
| for p in "`pidof $NAME`";do |
| status_of_proc -p /var/run/$NAME.pid $APPDIR/$APPBIN $NAME && exit 0 || exit $? |
| echo "Usage: $NAME {start|stop|restart|status}" >&2 |