- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Startup/Shutdown script for OpenSSH
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 05:49 AM
06-03-2002 05:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 05:51 AM
06-03-2002 05:51 AM
Solutionhttp://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x627e42308663d611abdb0090277a778c,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 06:20 AM
06-03-2002 06:20 AM
Re: Startup/Shutdown script for OpenSSH
PATH=/usr/sbin:/usr/bin:/sbin
export PATH
# NOTE: If your script executes in run state 0 or state 1, then /usr might
# not be available. Do not attempt to access commands or files in
# /usr unless your script executes in run state 2 or greater. Other
# file systems typically not mounted until run state 2 include /var
# and /opt.
rval=0
# Check the exit value of a command run by this script. If non-zero, the
# exit code is echoed to the log file and the return value of this script
# is set to indicate failure.
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1 # script FAILed
fi
}
case $1 in
'start_msg')
# Emit a _short_ message relating to running this script with
# the "start" argument; this message appears as part of the checklist.
# the following line was the standard line. replaced by the next line.
# echo "Starting the
echo "Starting the Secure Shell Daemon"
;;
'stop_msg')
# Emit a _short_ message relating to running this script with
# the "stop" argument; this message appears as part of the checklist.
# echo "Stopping the
echo "Stopping the Secure Shell Daemon"
;;
'start')
# source the system configuration variables
if [ -f /etc/rc.config.d/sshd ] ; then
. /etc/rc.config.d/sshd
else
echo "ERROR: /etc/rc.config.d/sshd defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ $SSHD != 1 ]; then
rval=2
else
echo "Starting Secure Shell Daemon"
/opt/openssh2/sbin/sshd
set_return
fi
;;
'stop')
# source the system configuration variables
if [ -f /etc/rc.config.d/sshd ] ; then
. /etc/rc.config.d/sshd
else
echo "ERROR: /etc/rc.config.d/sshd defaults file MISSING"
fi
# Check to see if this script is allowed to run...
if [ $SSHD != 1 ]; then
rval=2
else
echo "Stopping Secure Shell Daemon"
KSSH=`cat /var/run/sshd.pid`
kill -9 $KSSH
set_return
:
# Execute the commands to stop your subsystem
fi
;;
*)
echo "usage: $0 {start|stop}"
rval=1
;;
esac
exit $rval
GL,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 06:28 AM
06-03-2002 06:28 AM
Re: Startup/Shutdown script for OpenSSH
Copy the attached file to /sbin/init.d/sshd (based on HP's template for rc files /sbin/init.d/template):
Create /etc/rc.config.d/sshd with the following contents:
#!/sbin/sh
#
# OpenSSH daemon configuration
#
# SSH_ENABLED: Set to 1 to enable starting of OpenSSH daemon
#
SSH_ENABLED=1
Create symlinks in the rc directories for starting and stopping sshd:
ln -s /sbin/init.d/sshd /sbin/rc3.d/S050sshd
ln -s /sbin/init.d/sshd /sbin/rc2.d/K950sshd
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2002 10:03 AM
06-03-2002 10:03 AM