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.