Installing opensshd on Sun Cobalt Linux, shell interpreter issue

David Levy David.Levy at Sun.COM
Wed Jan 4 19:58:13 EST 2006

I have just installed openssh on my Sun Cobalt Qube, running Linux.

The shell interpreter for the rc script forces /sbin/sh. This is defined 
in This shell does not exist on this implementation of 
Linux. I have written about this in (much more) detail at NB This would seem 
to me to be a common problem but I havn't found any references in the 

The following bourne shell code would test for the requirement for a fix.

if [ ! -x /sbin/sh ] && [ -x /bin/sh ]
# Change the shell interpreter
#  .......

I suggest that

if [ ! -x /sbin/sh ]&& [ -x /bin/sh ]
# Change the shell interpreter
  cat ${opensshd_script_name} | sed -e "s?\#\!/sbin/sh?\#\!/bin/sh?g"  \
         >> ${opensshd_script_name}.${script_ver}

would be one way of doing it.

This would yield a file called The "if shell 
exists" test would need to be repeated in the install script to ensure 
that the correct script was copied from the install directory to 
/etc/rc.d/init.d directory.

The blog article also 
discusses Linux's chkconfig. This would be simple to implement and on 
systems where it exists, make the install task simpler. (Is this an 
enhancement request?)  This suggests that one script file for non 
chkconfig aware implementations and one for those that have it, although 
the only requires comment lines added. The install 
script would need to check for the existence of chkconfig and an 
implementation name scheme would need to be developed.

NB I am considering writing a "status" branch for opensshd.init, let me 
know if anyone's interested. (I shall probably only browse the process 
table and test it on my Qube's Linux).



<> 	* David Levy *
*Sun Microsystems Ltd.*
55, King William St.,
London EC4R 9ND United Kingdom

Phone +44 (0) 20 7469 9908/x18308
Mobile +44 (0) 7710-360922
Email David.Levy at Sun.COM

Sun Proprietary & Confidential . This e-mail message is for the sole use 
of the intended recipient(s) and may contain confidential and 
privilidged information. Any unauthorised review, use, disclosure or 
distribution is prohibited. If you are not the intended recepient, 
please contact the sender by reply e-mail and destroy all copies of the 
original message.

More information about the openssh-unix-dev mailing list