Re: rc.d_scripts/start_up_files

Cameron Simpson <[email protected]>
Newsgroups gmane.linux.redhat.release.enigma
Message-ID <[email protected]>
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]>
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.