Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Sep 1995 09:57:13 -0400 (EDT)
From:      Bill/Carolyn Pechter <pechter@shell.monmouth.com>
To:        ports@freebsd.org
Subject:   Startup scripts
Message-ID:  <199509201357.JAA12432@shell.monmouth.com>

next in thread | raw e-mail | index | archive | help
> 
> Here is my view on this matter:
> 
> I belive the scripts should support three arguments:
> 	start
> 	stop
> 	restart

I think restart isn't needed.  Stop followed by start should work for
restart.

> 
> I belive we need to scan multiple directories, and support the following
> semi-hardcoded paths:
> 
> 	/etc/rc.d
> 		for the root's own hacks and for major startup tasks
> 		("sh /etc/rc.d/nfs restart" would be a wonderful thing....)

OK...  I think /etc/init.d sould be a master repository for them all
like SVR4.j

> 
> 	/etc/pkg/rc.d
> 		for installed packages startup tasks
> 	/etc/X11/rc.d
> 		for X11 related startup tasks.

Why not use /etc/init.d if there's no name conflict with any existing
program?

> 
> It should all be under /etc because the security goes south if we are not
> very careful.

Agreed.

> 
> And that's all folks...

Yes! Yes! Yes... this looks a lot like SVR4 (well, AT&T did this in SVR3).
I tend to like the method they use.

Here's a quick description for those who haven't seen it.

/etc/init.d -- startup scripts 
/etc/rc?.d  -- scripts that get run at run level ? (Yup, I know we don't have
multiple run levels -- but I can hope...)

The scripts start with S?? and run through to S99 or so...
The admin symlinks or copies /etc/init.d/nfs to /etc/rc3.d/S35nfs to make it the
35th (assuming all #s are allocated) startup script to run in the system.
(And it runs at run-level 3)

the /etc/init.d/nfs script is also linked to a K35nfs which is used to kill
the process when going to a different run state -- in our case single user.


The rc? script (one for each run level) does  the following
                                                    
for i in K*
do
 sh K* stop
done

for  i in S*
do
 sh S* start
done

Adding routines involves dropping them into /etc/init.d/ and linking
them.  No edits, no hacking, no broken /etc/rc problems.  At worst case
only ONE routine (for the newsest program) bombs.


Bill

-------------------------------------------------------------------------------
 Bill Pechter/Carolyn Pechter        | The postmaster always pings twice.
 Lakewood MicroSystems               | 17 Meredith Drive,
 908-389-3592                        | Tinton Falls, NJ 07724       
 pechter@shell.monmouth.com          |



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509201357.JAA12432>