Menu

#5 Add a System V startup script

open
nobody
None
5
2003-07-30
2003-07-30
Anonymous
No

Could you please add a System V startup script
(/etc/init.d/swatch) so that swatch can be easily
started in daemon mode?

If required, I can submit a script that works for Red
Hat and SuSE, and possibly other distributions/Unices
as well.

Discussion

  • Kenneth Valis

    Kenneth Valis - 2003-08-06

    Logged In: YES
    user_id=834923

    Here is one that I have been using. Called /etc/init.d/swatch

    #!/sbin/sh
    #
    # Copyright (c) 1997-1998 by Sun Microsystems, Inc.
    # All rights reserved.
    #
    #ident "@(#)cron 1.13 98/04/19 SMI"
    DBNAME=ben

    case "$1" in
    'start')
    /usr/local/bin/swatch -t /var/adm/messages &
    ;;

    'stop')
    /usr/bin/pkill -n swatch &
    ;;

    *)
    echo "Usage: $0 { start | stop }"
    exit 1
    ;;
    esac
    exit 0

     
  • Nobody/Anonymous

    Logged In: NO

    #! /bin/sh
    # /etc/init.d/swatch
    #
    set -e

    DAEMON=/usr/bin/swatch

    test -x $DAEMON || exit 0

    case "$1" in
    start)
    echo -n "Starting swatch /etc/swatchrc"
    $DAEMON -c /etc/swatchrc --daemon
    echo "done"
    ;;
    stop)
    echo -n "killall swatch"
    ;;
    *)
    echo "Usage: /etc/init.d/$NAME {start}"
    exit 1
    ;;

    esac
    exit 0

     

Log in to post a comment.

MongoDB Logo MongoDB