SUMMARY: [Q] Solaris boot up ignore "#!/bin/ksh" on autostart file ?? ??

From: bbb bb <mccux1_at_hotmail.com>
Date: Fri Jun 04 2004 - 15:15:05 EDT
Thank you for so many people give me answer.

When Solaris system boot up.  it will run all startup  files (SXXX or Kxxx) 
under /etc/rcX use following way:

/sbin/sh $f start   or /sbin/sh $f stop

the first line on file "#!/sbin/ksh" will be ignore and run by /sbin/sh"

However, if you want to force ksh, you can add theses two lines at the
begining of the script :

[ "$1" != LAUNCH_KSH ] && echo "ksh scripting..." && exec ksh $0 LAUNCH_KSH 
$*
shift

Thanks again to all the people who answer my questions.

My original post:
>
>I have a "KSH" program put on /etc/rc3.d/S99test (Solaris 9).  This program
>first line has "#!/bin/ksh" in it.  If I run it use  "./S99test start", it
>work fine withour error message.  If I reboot server and I get error 
>message
>
>when system bootup.  Look like system boot up ignore "#!/bin/ksh" and still
>run it use "/bin/sh".
>
>E.g.
>
># ./S99test start
>
>case "$1" in
>'start')
>A=`ping 172.29.21.15|grep alive|wc -l`
>
>echo $A
>if ((A == 1))
>then
>         echo "Network UP"
>else
>         echo "Network DOWN"
>         exit
>fi
>;;
>'stop')
>;;
>esac
>1
>Network UP
>
>===================================================
>When system boot up:
>
>case "$1" in
>'start')
>A=`ping 172.29.21.15|grep alive|wc -l`
>
>echo $A
>if ((A == 1))
>then
>         echo "Network UP"
>else
>         echo "Network DOWN"
>         exit
>fi
>;;
>'stop')
>;;
>esac
>1
>/etc/rc3.d/S99test: A: not found
>Network DOWN
>
>
>=======================================
>
>Anyone has ideal, why system boot up ignore /bin/ksh????
>
>Thanks.
>
>_________________________________________________________________
>Getting married? Find great tips, tools and the latest trends at MSN Life
>Events. http://lifeevents.msn.com/category.aspx?cid=married
>_______________________________________________
>sunmanagers mailing list
>sunmanagers@sunmanagers.org
>http://www.sunmanagers.org/mailman/listinfo/sunmanagers

_________________________________________________________________
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! 
http://join.msn.click-url.com/go/onm00200362ave/direct/01/
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Jun 4 15:14:59 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:31 EST