Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: syl@alcor.concordia.ca (Sylvain Robitaille)
Subject: Re: How to launch sshd during Tru64 startup?
Date: 13 Jun 2002 15:20:06 GMT	[thread overview]
Message-ID: <aead76$7ub$1@newsflash.concordia.ca> (raw)
In-Reply-To: 6445524b.0206130655.4c91c84b@posting.google.com

On 13 Jun 2002 07:55:56 -0700, Dub <dub@latnet.lv> wrote:

> Question. How to launch sshd during startup in the most elegant way?

Place a startup script in /sbin/init.d, and link to it from
/sbin/rc[023].d

It doesn't have to be elaborate;  It just needs to understand (and act
on) 'start', 'stop', and perhaps 'restart' as a single argument.

See a sample below my signature.  I hope that helps...

-- 
----------------------------------------------------------------------
Sylvain Robitaille                              syl@alcor.concordia.ca
 
Systems analyst                                   Concordia University
Instructional & Information Technology        Montreal, Quebec, Canada
----------------------------------------------------------------------

#!/bin/sh
#
# Start/Stop the secure shell daemon.

SERVICE="Secure shell"
DAEMON=/local/bin/sshd
PIDFILE=/var/run/sshd.pid

case $1 in
  'start')
    if [ -x ${DAEMON} ]
    then
      $DAEMON
      # Error checking here would be good...
      echo "${SERVICE} started."
    else
      echo "Can't find file ${DAEMON}."
      echo "${SERVICE} NOT started."
    fi
  ;;
  'stop')
    if [ -s ${PIDFILE} ]
    then
      if kill `cat ${PIDFILE}` >/dev/null 2>&1
      then
        echo "${SERVICE} terminated."
        rm -f ${PIDFILE}
      fi
    fi
  ;;
  'restart')
    $0 stop
    $0 start
  ;;
  *)
    echo "Usage: $0 start|stop|restart"
    ;;
esac



  reply	other threads:[~2002-06-13 15:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-13 14:55 How to launch sshd during Tru64 startup? Dub
2002-06-13 15:20 ` Sylvain Robitaille [this message]
2002-06-13 21:39 ` Nico Kadel-Garcia
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox