Bug 1144

Summary: Generated rc script for sshd forces non-existent shell.
Product: Portable OpenSSH Reporter: Dave Levy <david.levy>
Component: Build systemAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: normal    
Priority: P2    
Version: 4.2p1   
Hardware: ix86   
OS: Linux   
Attachments:
Description Flags
Have configure check for the existence of /sbin/sh none

Description Dave Levy 2006-01-12 05:42:11 AEDT
I have just installed openssh on my Sun Cobalt Qube, running Linux. It is a Red Hat variant.

The shell interpreter for the rc script forces /sbin/sh. This seems to be defined in opensshd.init.in. This shell does not exist on this implementation of Linux. I have written about this in (much more) detail at http://blogs.sun.com/roller/page/DaveLevy/20060104. 

NB This would seem to me to be a common problem but I havn't found any references in the archives.

A simple check to see if there is /sbin/sh could be made and the first line of the script amended dependent on the result of the test. The copy statement, moving the generated script from the build directory to the installed directory may require to be managed by a similar test. The blog article above has code examples which I wrote and you are free to use.
Comment 1 Darren Tucker 2006-01-12 18:44:14 AEDT
Created attachment 1050 [details]
Have configure check for the existence of /sbin/sh

Getting configure to check for this is easy provided you're doing native builds and not cross-compiling.
Comment 2 Tim Rice 2006-01-13 09:34:56 AEDT
The openssh.init startup script was never intended to work on all platforms.
If you Cobalt Qube is a Red Hat variant, you may be better off with contrib/redhat/sshd.init

That said, if Darren wants to commit the patch, It's OK by me.
Comment 3 Darren Tucker 2006-01-30 00:23:25 AEDT
Patch applied, thanks.
Comment 4 Darren Tucker 2006-10-07 11:44:07 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.