Mike Gerdts writes:
> IMHO this behavior is one of those backwards things that Solaris has
> always done that should be fixed if someone in the community is
> willing to do it.  Sure - SMF is the way forward but it is overly
> complicated for a new Solaris user to understand how to add a service.

If that's true (I don't think I really agree, but let's suppose), then
why not fix *that* problem instead?  Let's make it trivial to add a
new service, so that resorting to rc scripts -- and the lack of system
management support they imply -- just isn't necessary.

> In the past, scripts in /etc/rc*.d did not need to be executable to
> work.  The suggested workaround is to use the existing behavior IFF
> the file is not executable.  Otherwise, simply run the program and let
> the OS determine if it is a bourne shell script, perl script, or ELF
> executable.  If someone added a shell script without the shebang, I'm
> pretty sure the interpreter will default to /bin/sh so that should not
> be a worry.

The only reason I can see to support rc scripts is to allow for
compatibility with older releases of Solaris (or perhaps even with
other OSes).  In that case, you _have to_ live with the constraints
that those older releases continue to have -- which means that
"#!/bin/ksh" just isn't going to work.

An rc script should just start the service; it shouldn't be a magnum
opus.  Frankly, I think that if you're doing anything in an rc script
that is so complicated that the difference between legacy Bourne shell
and the newer Korn shells makes any real difference, then you're doing
something deeply wrong.

-- 
James Carlson, Solaris Networking              <james.d.carlson at sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

Reply via email to