Summary: sshd won't start from rc3.d

From: richard n. frank <rnfrank_at_wolfram.llnl.gov>
Date: Mon, 17 May 1999 14:10:29 -0700 (PDT)

Many thanks to:

John P Speno <speno_at_isc.upenn.edu>
Steve VanDevender <stevev_at_hexadecimal.uoregon.edu>
"Sean O'Connell" <sean_at_stat.Duke.EDU>
"Jeff Berliner" <jeff_at_endeavor.med.nyu.edu>
Graham Allan <ALLAN_at_mnhep1.hep.umn.edu>
Don Becker <becker_at_adelphi.edu>
"Brian Parkhurst" <brianp_at_u.washington.edu>
"Skeate, Scott B" <scott.b.skeate_at_lmco.com>
Paul Scowen <paul.scowen_at_asu.edu>
"Serguei Patchkovskii" <patchkov_at_ucalgary.ca>
Paul A Sand <pas_at_unh.edu>
and last but not least
"Dr. Tom Blinn, 603-884-0646" <tpb_at_doctor.zk3.dec.com>
-----------------------------------------------------------
The problem was I was linking from rc3.d to the executable itself
rather than linking to a script which will start or stop the daemon.

Steve VanDevender provided this detailed explanation and script. Many
of the experts responding provided similar scripts and explanations.
------------------------------------------------------------------
Steve VanDevender:

>... That's probably because init scripts are not supposed to be links
>directly to the binaries they start. Init scripts are expected
>to be shell scripts called with the argument "start" on system
>boot and with "stop" on system shutdown.
>
>I suggest using an init script like this to start sshd; it's
>based on a similar existing script. You would put this in
>/sbin/init.d/sshd and then make the symlink from
>/sbin/init.d/rc3.d/S97sshd to it:
>
>#!/sbin/sh
>
>PATH=/sbin:/usr/sbin:/usr/bin
>export PATH
>
>case "$1" in
>'start')
> if [ -f /usr/local/sbin/sshd ]; then
> /usr/local/sbin/sshd
> echo "ssh service started"
> else
> echo "Unable to start ssh service -- no /usr/local/sbin/sshd"
> exit 1
> fi
> ;;
>'stop')
> pid=`cat /var/run/sshd.pid`
> if [ "X$pid" != "X" ]; then
> /bin/kill $pid
> else
> echo "No pid for ssh service found"
> exit 1
> fi
> ;;
>'restart')
> /sbin/init.d/sshd stop
> if [ $? -ne 0 ]; then
> echo " -- Could not find running sshd - attempting to restart..."
> fi
> sleep 2
> /sbin/init.d/sshd start
> ;;
>*)
> echo "usage: $0 {start|stop|restart}"
> ;;
>esac
>
-----------------------------------------------------------

A thousand thanks to all and a lesson learned for me.
       
                                                       rich frank
                                                       rnfrank_at_llnl.gov
Received on Mon May 17 1999 - 21:06:09 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT