RE: rc.d_scripts/start_up_files

"dhd" <[email protected]>
Newsgroups gmane.linux.redhat.release.enigma
Message-ID <[email protected]>
Hey, thanks!  It was just csh/bash differences (I was using #!csh in the
first line and 'switch' stuff instead of 'case' stuff - It works fine now -
thanks again.

-----Original Message-----
From: [email protected] [mailto:[email protected]]On
Behalf Of Cameron Simpson
Sent: Thursday, April 17, 2003 8:29 PM
To: [email protected]
Subject: Re: rc.d_scripts/start_up_files

On 19:45 17 Apr 2003, dhd <[email protected]> wrote:
| I'm having trouble getting a few services to start automatically.  I'm
using
| RH 7.2 and I'm using csh as my login shell.  I've been trying to
accomplish
| this by creating a rc.d script, but can't get it working.  The command in
my
| script works properly when I test it in a terminal but doesn't run when on
| restart/relogin.

Startup scripts run are boot time or shutdown time. Not at login time.

| Does anyone know of a good resource I could access for
| info on how this process is structured?

Scripts expect a single argument, being "start" or "stop". On RedHat
"restart" and "status" are egenrally implemented too. So the script usually
has the form:

        #!/bin/sh
        ... do some setup stuff, like read configs etc ...
        case "$1" iin
          start)
            start the daemon or service here
            ;;
          stop)
            stop the daemon or service here
            ;;
          status)
            report on the upness of the daemon
            ;;
          restart)
            "$0" stop
            "$0" start
            ;;
          *)echo "Usage: $0 {start|stop|status|restart}" >&2; exit 2
            ;;
        esac

| I placed the script /etc/rc2.d  Do

Sounds like you're writing in csh. Startup scripts are Bourne shell.
See "man sh" for details. Or just copy and hack an existing script.

| I also need a reference to the script in my /.cshrc file?

No.

Cheers,
--
Cameron Simpson, DoD#743        [email protected]    http://www.zip.com.au/~cs/

Trust the computer industry to shorten Year 2000 to Y2K. It was this
thinking that caused the problem in the first place.
- Mark Ovens <[email protected]>



_______________________________________________
enigma-list mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/enigma-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.