Help with /etc/rc3.d and /etc/init.d?

Help with /etc/rc3.d and /etc/init.d?

Post by Anthony E. Col » Thu, 19 Aug 1999 04:00:00




Sorry, I didn't include all of the original post.

I'm running Solaris x86 7 and would like to have Samba and some other
stuff start up at boot time.  I'm confused on the exact process of how
scripts should be setup between /etc/rc?.d and /etc/init.d.  I've
looked at several scripts in the /etc/rc?.d and /etc/init.d
directories and the scripts seem to be the same.  (I actually did a
diff on /etc/rc3.d/S##filename and /etc/init.d/samefilename and there
doesn't apear to be a difference between these files.)  I have noticed
that all the scripts are using case statements.  Do I have to use this
formal type scripting or can I just put something like this?

#!/bin/sh

/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D

The above script will start Samba if invoked.

If the above script will work in /etc/rc3.d/ can I just put the same
script in /etc/init.d and have it start at boot time?  I.e.,

/etc/rc3.d/S77startsmb
/etc/init.d/startsmb

Kindest regards,

Anthony

 
 
 

Help with /etc/rc3.d and /etc/init.d?

Post by Anthony E. Col » Thu, 19 Aug 1999 04:00:00


scripts should be setup between /etc/rc?.d and /etc/init.d.  I've
looked at several scripts in the /etc/rc?.d and /etc/init.d
directories and the scripts seem to be the same.  (I actually did a
diff on /etc/rc3.d/S##filename and /etc/init.d/samefilename and there
doesn't apear to be a difference between these files.)  I have noticed
that all the scripts are using case statements.  Do I have to use this
formal type scripting or can I just put something like this?

#!/bin/sh

/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D

The above script will start Samba if invoked.

If the above script will work in /etc/rc3.d/ can I just put the same
script in /etc/init.d and have it start at boot time?  I.e.,

/etc/rc3.d/S77startsmb
/etc/init.d/startsmb

Kindest regards,

Anthony

 
 
 

Help with /etc/rc3.d and /etc/init.d?

Post by Phil Edward » Thu, 19 Aug 1999 04:00:00




Quote:> looked at several scripts in the /etc/rc?.d and /etc/init.d
> directories and the scripts seem to be the same.  (I actually did a
> diff on /etc/rc3.d/S##filename and /etc/init.d/samefilename and there
> doesn't apear to be a difference between these files.)

The truth is even better:  they are the /same/ file.  Literally.  Only
a single copy of the file exists, but it appears in multiple places.
It's kinda like the "shortcuts" that you're used to under Winblows, but
"shortcuts on steroids" instead.  They're called "hard links," and
they're difficult to explain if you don't know filesystems...

Quote:>  I have noticed
> that all the scripts are using case statements.  Do I have to use this
> formal type scripting or can I just put something like this?

You should read /etc/rc3.d/README and then /etc/init.d/README (no,
those aren't the same :-) for an explanation of how init files work
under Solaris (and other SysV-style inits).  The init man page is
also good to read, and you can look over the scripts that /call/ the
rcN.d scripts by reading /etc/rcN directly.

Briefly, the script you have will work to start Samba.

Quote:> If the above script will work in /etc/rc3.d/ can I just put the same
> script in /etc/init.d and have it start at boot time?  I.e.,

> /etc/rc3.d/S77startsmb
> /etc/init.d/startsmb

It isn't the presence of the file in init.d which starts the service;
it's the rcN.d file which does that.  The one in init.d is mainly there
for the administrators.  You can start (and stop) services by saying,
for example,

    /etc/init.d/sendmail stop
    /etc/init.d/sendmail start

which will kill and restart sendmail.  (Some scripts also take 'restart'
as a parameter, but that's rare).  If the init.d scripts weren't there,
you'd have to remember the sequence numbers of each service, or use
wildcards (can be dangerous as root), or go hunting around in rcN.d.

There's not much point in adding a Samba entry to init.d if you don't
do the case statements.  Only the rc3.d/S* entry will be needed to
start Samba on boot.

--

Targeting & Attack Radar                                  UFOs are real.
Air Force Research Labs                                   The Air Force
Senior Systems Administrator                              doesn't exist.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

Help with /etc/rc3.d and /etc/init.d?

Post by Peter Sundstro » Fri, 20 Aug 1999 04:00:00


more /etc/init.d/README

>scripts should be setup between /etc/rc?.d and /etc/init.d.  I've
>looked at several scripts in the /etc/rc?.d and /etc/init.d
>directories and the scripts seem to be the same.  (I actually did a
>diff on /etc/rc3.d/S##filename and /etc/init.d/samefilename and there
>doesn't apear to be a difference between these files.)  I have noticed
>that all the scripts are using case statements.  Do I have to use this
>formal type scripting or can I just put something like this?

>#!/bin/sh

>/usr/local/samba/bin/smbd -D
>/usr/local/samba/bin/nmbd -D

>The above script will start Samba if invoked.

>If the above script will work in /etc/rc3.d/ can I just put the same
>script in /etc/init.d and have it start at boot time?  I.e.,

>/etc/rc3.d/S77startsmb
>/etc/init.d/startsmb

>Kindest regards,

>Anthony

 
 
 

1. /etc/init.d/acct vs /etc/init.d/perf

I have been using /etc/init.d/acct to start accounting on my Solaris
servers.
What is the purpose of /etc/init.d/perf ?  The comment in /etc/init.d/perf
says:
# Uncomment the following lines to enable system activity data gathering.
# You will also need to uncomment the sa entries in the system crontab

...but /etc/init.d/acct already starts it, and I already edited the sys
crontab.
So what's the difference?  Just another way to start accounting?
Since I'm already collecting sar data, my real question is  Am I missing
something by not using /etc/init.d/perf ?

-Steve in Phx.

2. Pull-down menus' font size in Pan

3. Script to create startup scripts in /etc/init.d or /etc/rc?.d

4. Fix for your HomePages

5. CDE vs. /etc/passwd, /etc/shadow and /etc/group

6. SCO Technical Articles released on Jul 25 1998

7. ssh chrooted enviroment WITHOUT /bin /etc /lib - etc etc in the users dir ?

8. System Requirement for Server.

9. 3.5 MO, zip, etc, etc, etc.

10. ps/1, Lilo, etc etc etc problems w/ instalation

11. Looking for sample /etc/named.conf and etc/resolv.conf and /etc/hosts

12. LINUX, 3COM ImpactIQ, ISDN, etc, etc, etc...

13. HELP: Who calls /etc/rc3