On 3/7/07, Darren J Moffat <[EMAIL PROTECTED]> wrote:
William James wrote:
> This is not correct.
> Writing a SMF plug in FORCES me to use /bin/sh.
If by plug you mean SMF method script your statement is WRONG.
No it is not. You're wrong. Put /usr/bin/ksh into a SMF script and it
will not be executed.
Take for exampke the SMF method script for the svc:/system/cryptosvc
FMRI it isn't even a script but a compiled binary.
SMF does NOT require you to use any specific shell nor does it even
require that the method script be a shell script at all, there are
several that are in fact binaries. For example everything that is
started by the SMF delgated restarted svc.inetd is in fact a binary.
> Writing a script for /etc/init.d FORCES me to use /bin/sh
Not true, again it doesn't even have to be a shell script unless it ends
in .sh.
It will always use /bin/sh and ignores what you use as #! line in a
script. Files ending in .sh will be inlined (which is good since you
can set environment variables without using /etc/profile. SMF can't do
that).
> Changing /etc/profile FORCES me to make it /bin/sh compatibleu
Then make your bash specific changes in /etc/bash.profile, your zsh ones
in /etc/zprofile. That is EXACTLY why these shells have their own named
profile variants.
So you think /etc/profile is only for /bin/sh?
> Starting a shell from a system function like system() FORCES me to use
> /bin/sh or start another shell.
Blame the POSIX standard for that one! In fact if your application that
uses system is compiled as an XPG4 program you will actually get
/usr/xpg4/bin/sh not /bin/sh used.
No, I blame Solaris for not honoring the POSIX standard.
Cheers,
William
--
@,,@ William James
(\--/) [EMAIL PROTECTED]
(.>__<.) GNU/Solaris hacker
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code