On Mar 9,  9:13am, Michael J. Rensing wrote:
> 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?

Here is a simple startup script that we use.  The script is located in
/sbin/init.d.  You just need to create a symbolic link to it from a
rcX.d directory, depending on what init state you are running in
(ie. ln -s /sbin/rc2.d/S750ssh -> /sbin/init.d/ssh).

#
# ssh: rc script for SSH
#

killproc() {            # kill the named process(es)
        fpid='$2'
        fproc='$8'
        pid=`ps -ef | \
           awk "$fproc == \"$1\" || $fproc ~ /.*\/$1/ { print $fpid }"`
        [ "$pid" != "" ] && kill -KILL $pid
}


case $1 in
start_msg)
        echo "Start SSH"
        ;;

stop_msg)
        echo "Stop SSH"
        ;;


'start')

        if [ -f /etc/sshd_config -a -f /usr/sbin/sshd ]; then
                /usr/sbin/sshd
        else
                echo "SSH file missing, skipping SSH startup."
                exit 1
        fi

        ;;

'stop')

#
# Stop the sshd process
#
killproc sshd

        ;;

*)      echo "Invalid option supplied to $0"
        exit 1
        ;;
esac


-- 
James J. Barlow   <[EMAIL PROTECTED]>
System Engineer
National Center for Supercomputing Applications
605 East Springfield Avenue                        Voice : (217)244-6403
Champaign, IL 61820                                 Cell : (217)840-0601
http://www.ncsa.uiuc.edu/People/jbarlow              Fax : (217)244-1987

Reply via email to