Shell of /etc/init.d files on Solaris 8 - solution

From: Wingfield, John (WingfieldJ@logica.com)
Date: Fri Nov 29 2002 - 07:04:40 EST


Dear all

Many thanks for all your replies. This email is to summarise the solution.
The following is quoted from /etc/rc3:

for f in /etc/rc3.d/S*; do
        if [ -s $f ]; then
                case $f in
                        *.sh) . $f ;;
                        *) /sbin/sh $f start ;;
                esac
        fi
done

The script clearly starts scripts in /etc/rc3.d using /sbin/sh, therefore
csh scripts will not execute using csh. Many replies stated that csh should
be avoided altogether but if absolutely necessary a wrapper script would
have to be used in this case.

Best wishes

John

> -----Original Message-----
> From: Wingfield, John
> Sent: 29 November 2002 10:21
> To: 'sunmanagers@sunmanagers.org'
> Subject: Shell of /etc/init.d files on Solaris 8
>
> Dear all
>
> I've just put a new start-up script in /etc/init.d on a Solaris 8 server
> (V880). The script uses /bin/csh instead of /bin/sh or /sbin/sh. I have
> created a symbolic link from /etc/rc3.d/S96xxxxxx to the script.
>
> When the script is executed syntax errors are generated, almost as if
> Solaris is completely ignoring the "#!/bin/csh" at the beginning of the
> script and running it in Bourne shell. The script executes perfectly when
> run as root on a normal console.
>
> Can anyone tell me what's going on?
>
> Thanks
>
> John
>
> --
> John Wingfield
> Space & Defence
> Logica UK Limited
> +44 (0)20 7446 1075
> www.logica.com
>

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:22 EDT