Here is my startup script /sbin/init.d/sshd. Make is executable and then
link it to /sbin/rc3.d/S750sshd. Test it with /sbin/init.d/sshd start|stop.
Obviously, I installed sshd in /usr/local/sbin. Hope this helps. :-)

===========Cut Here=============
#!/sbin/sh
#
# sshd $Revision: 1.2.22 $ $Date: 98/1/28 10:09:43 $
#
#     Installed by Don Esry
#

PATH=/sbin:/usr/sbin:/usr/bin
export PATH

rval=0
set_return() {
        x=$?
        if [ $x -ne 0 ]; then
                echo "EXIT CODE: $x"
                rval=1  # always 1 so that 2 can be used for other reasons
        fi
}

case $1 in
start_msg)
        echo "Start Secure Shell Daemon"
        ;;

stop_msg)
        echo "Stopping Secure Shell Daemon"
        ;;

'start')
        if [ -f /etc/rc.config ] ; then
                . /etc/rc.config
        else
                echo "ERROR: /etc/rc.config defaults file MISSING"
        fi

        if [ "$SSHD" -eq 1 -a -x /usr/local/sbin/sshd ]; then

                /usr/local/sbin/sshd && echo "sshd  \c"
                set_return
        else
                rval=2
        fi
        ;;

'stop')
        if [ -f /etc/rc.config ] ; then
                . /etc/rc.config
        else
                echo "ERROR: /etc/rc.config defaults file MISSING"
        fi

        #
        # Determine PID of process(es) to stop
        #
        if [ "$SSHD" -ne 1 ]; then
            rval=2
        fi
                # Don't grab the pid of the KILL script "grep -v K"
                # We only want the daemon
#           pid=`ps -e | grep -v K | awk '$NF~/sshd/ {print $1}'`
            pid=`ps -el | grep -v K | awk '( ($NF ~ /sshd/) && ($4 != mypid)
&& ($5 != mypid)) { print $4 }' mypid=$$ `
            if [ "X$pid" != "X" ]; then
                if kill $pid; then
                    echo "sshd stopped"
                else
                    rval=1
                    echo "Unable to stop sshd"
                fi
            else
                rval=1
                echo "ERROR: Unable to stop sshd (cannot find pid)"
            fi
        ;;
*)
        echo "usage: $0 {start|stop}"
        rval=1
        ;;
esac

exit $rval
=============Cut Here============

-----Original Message-----
From: Michael J. Rensing [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 09, 1999 12:13 PM
To: [EMAIL PROTECTED]
Subject: Re: Any HPUX administrators?


I got a number of replies which answered some of my questions.
Thanks, everyone.

I had already downloaded and compiled ssh successfully. My main
'installation' question is: How are people installing sshd to run each
time the system is re-booted? I want the daemon to come up
automatically whenever it crashes, or the system is re-booted. I could
put it in the /etc/inittab file, or I could configure it completely
with startup scripts in the various rc files. The problem is that I
don't know much about the rc methods under HP, and I'd like to know
what the conventions are. Has anyone done it this way?

 On Fri, 5 Mar 1999, Michael J. Rensing wrote:

>2) Has anyone got experience installing sshd on HPUX 10.20? I could
>use some help with this. Installing daemons is new to me.

                                  Michael

------------------------------------------------------------
Dr. Michael J. Rensing | http://wwwhep.phys.uvic.ca/~michael
                       |             mailto:[EMAIL PROTECTED]
Physics and Astronomy  |                 phone: 250-721-7741 
University of Victoria |                   fax: 250-721-7752
------------------------------------------------------------

Reply via email to