Re: Help - How to auto start a command

From: Lamar Thomas (noreply_at_noreply.com)
Date: 07/17/04

  • Next message: lampiasi: "Re: Kmenuedit Change's Not Saves"
    Date: Sat, 17 Jul 2004 04:33:50 -0700
    
    

    Thanks Scott!

    Lamar

    "Scott Lurndal" <scott@slp53.sl.home> wrote in message
    news:Vm_Jc.21148$id5.20660@newssvr27.news.prodigy.com...
    > "Lamar Thomas" <noreply@noreply.com> writes:
    > >Will this work with the "BASH" shell? I saw that you used "#!/bin/ksh".
    >
    > yes. I personally prefer the korn shell (pdksh or the real thing), but
    > the script I attached uses only Posix semantics so should work with
    > either shell.
    >
    > scott
    >
    > >
    > >
    > >Lamar
    > >
    > >
    > >"Scott Lurndal" <scott@slp53.sl.home> wrote in message
    > >news:u5YJc.92986$uC4.18617@newssvr29.news.prodigy.com...
    > >> "Lamar Thomas" <noreply@noreply.com> writes:
    > >> >I am running RH 9.0 and I have the following commands that I have to
    run
    > >> >EVERY time I restart my system. The commands start a chat server that
    is
    > >> >running on my system.
    > >> >
    > >> >
    > >> >
    > >> >Can someone tell me what I need to do to get these commands to run
    > >> >automaticly in run level 3 and 5 each time I restart the system? I am
    > >using
    > >> >bash and ssh to do this remotely.
    > >>
    > >> create this file: /etc/rc.d/init.d/jabber
    > >> (see below for contents)
    > >> then
    > >> # chkconfig jabber on
    > >> # service jabber start
    > >>
    > >> ----
    > >> #!/bin/ksh
    > >> #
    > >> # Start jabber
    > >> #
    > >> # chkconfig: 2345 91 09
    > >> #
    > >>
    > >> . /etc/init.d/functions
    > >>
    > >> . /etc/sysconfig/network
    > >>
    > >> [ ${NETWORKING} = "no" ] && exit 1
    > >>
    > >> [ -f /usr/local/jabber/jabber-1.4.2/jabberd/jabberd ] || exit 1
    > >>
    > >> jabber=/usr/local/jabber/jabber-1.4.2/jabberd/jabberd
    > >> prog=jabber
    > >> RETVAL=0
    > >>
    > >> start () {
    > >> # Start daemons.
    > >>
    > >> echo -n $"Starting $prog: "
    > >>
    > >> daemon ${jabber} -D
    > >> daemon ${jabber} -c muc.xml -D
    > >>
    > >> RETVAL=$?
    > >> echo
    > >> [ $RETVAL -eq 0 ] && touch /var/lock/subsys/jabber
    > >> return $RETVAL
    > >> }
    > >> stop () {
    > >> # Stop daemons.
    > >> echo -n $"Shutting down $prog: "
    > >> killproc jabber
    > >> RETVAL=$?
    > >> echo
    > >> [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/jabber
    > >> return $RETVAL
    > >> }
    > >> restart() {
    > >> stop
    > >> start
    > >> }
    > >>
    > >> # See how we were called.
    > >> case "$1" in
    > >> start)
    > >> start
    > >> ;;
    > >> stop)
    > >> stop
    > >> ;;
    > >> status)
    > >> status jabber
    > >> ;;
    > >> restart|reload)
    > >> restart
    > >> ;;
    > >> *)
    > >> echo $"Usage: $0 {start|stop|status|restart|reload}"
    > >> exit 1
    > >> esac
    > >>
    > >>
    > >> exit 0
    > >>
    > >
    > >


  • Next message: lampiasi: "Re: Kmenuedit Change's Not Saves"

    Relevant Pages

    • Re: Help - How to auto start a command
      ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
      (comp.os.linux.networking)
    • Re: Help - How to auto start a command
      ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
      (linux.redhat)
    • Re: Help - How to auto start a command
      ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
      (comp.os.linux.misc)
    • Re: Help - How to auto start a command
      ... I personally prefer the korn shell (pdksh or the real thing), ... > the script I attached uses only Posix semantics so should work with ...
      (linux.redhat.misc)
    • Re: Running a job in AIX
      ... command to show what is in the queue, ... we create a short script that sets our environment ... into an sql table, then runs an sql procedure to process the data in ... I would recommend that you get a copy of "Learning the Korn Shell" from ...
      (comp.unix.aix)