Hi,

Below please find a Fedora 9 init.d start script for exalt-daemon. 
exalt(-daemon) is mainly working for me now and I have therefore 
replaced NetworkManager with it, so I wanted to have the daemon started 
at system boot. The script is an altered version of that shipping with 
NetworkManager. With appropriate changes I guess it might work for other 
distros as well (eg. SuSE). Please let me know if there's sth. wrong 
with it, works for me, though.

Best,   Nick.



#!/bin/sh
#
# exalt-daemon:   exalt daemon
#
# chkconfig: - 27 84
# description:  This is a daemon for automatically switching network 
connections
#
# processname: exalt-daemon
# pidfile: /var/run/exalt-daemon/exalt-daemon.pid
#
### BEGIN INIT INFO
# Provides: exalt_daemon $network
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop exalt-daemon
# Description: exalt-daemon is a tool for easily managing network 
connections
### END INIT INFO

prefix=/usr
exec_prefix=/usr
sbindir=/usr/sbin

NETWORKMANAGER_BIN=${sbindir}/exalt-daemon

# Sanity checks.
[ -x $NETWORKMANAGER_BIN ] || exit 1

# We need /sbin/pidof
[ -x /sbin/pidof ] || exit 1

# Source function library.
. /etc/rc.d/init.d/functions

# Source network configuration
. /etc/sysconfig/network

# so we can rearrange this easily
processname=exalt-daemon
servicename=exalt-daemon
pidfile=/var/run/exaltd.pid

RETVAL=0

start()
{
    if [ -n "`/sbin/pidof -o %PPID $processname`" ]; then
    echo -n "${servicename} is already running"
    failure
        echo
        exit 1
    fi

    echo -n $"Setting network parameters... "
    sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
    success
    echo
   
    echo -n $"Starting exalt daemon: "
    daemon --pidfile=$pidfile --check $servicename $processname
    RETVAL=$?

    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
}

stop()
{
    echo -n $"Stopping exalt daemon: "
    killproc -p $pidfile $servicename
    RETVAL=$?
    echo
    if [ $RETVAL -eq 0 ]; then
    rm -f /var/lock/subsys/$servicename
    rm -f $pidfile
    fi
}

# See how we were called.
case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    status)
    status -p $pidfile $processname
    RETVAL=$?
    ;;
    restart)
    stop
    start
    ;;
    condrestart)
    if [ -f /var/lock/subsys/$servicename ]; then
        stop
        start
    fi
    ;;
    *)
    echo $"Usage: $0 {start|stop|status|restart|condrestart}"
    ;;
esac

exit $RETVAL

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to