Blame openssh-4.3p2-initscript.patch
|
Tomáš Mráz |
19675a |
--- openssh-4.3p2/contrib/redhat/sshd.init 2002-05-10 04:19:23.000000000 +0200
|
|
Tomáš Mráz |
19675a |
+++ sshd 2006-11-02 14:23:27.000000000 +0100
|
|
Tomáš Mráz |
19675a |
@@ -29,6 +29,8 @@
|
|
Tomáš Mráz |
19675a |
DSA_KEY=/etc/ssh/ssh_host_dsa_key
|
|
Tomáš Mráz |
19675a |
PID_FILE=/var/run/sshd.pid
|
|
Tomáš Mráz |
19675a |
|
|
Tomáš Mráz |
19675a |
+runlevel=$(set -- $(runlevel); eval "echo \$$#" )
|
|
Tomáš Mráz |
19675a |
+
|
|
Tomáš Mráz |
19675a |
do_rsa1_keygen() {
|
|
Tomáš Mráz |
19675a |
if [ ! -s $RSA1_KEY ]; then
|
|
Tomáš Mráz |
19675a |
echo -n $"Generating SSH1 RSA host key: "
|
|
Tomáš Mráz |
19675a |
@@ -93,9 +95,11 @@
|
|
Tomáš Mráz |
19675a |
do_rsa1_keygen
|
|
Tomáš Mráz |
19675a |
do_rsa_keygen
|
|
Tomáš Mráz |
19675a |
do_dsa_keygen
|
|
Tomáš Mráz |
19675a |
+
|
|
Tomáš Mráz |
19675a |
+ cp -af /etc/localtime /var/empty/sshd/etc
|
|
Tomáš Mráz |
19675a |
|
|
Tomáš Mráz |
19675a |
- echo -n $"Starting $prog:"
|
|
Tomáš Mráz |
19675a |
- initlog -c "$SSHD $OPTIONS" && success || failure
|
|
Tomáš Mráz |
19675a |
+ echo -n $"Starting $prog: "
|
|
Tomáš Mráz |
19675a |
+ $SSHD $OPTIONS && success || failure
|
|
Tomáš Mráz |
19675a |
RETVAL=$?
|
|
Tomáš Mráz |
19675a |
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/sshd
|
|
Tomáš Mráz |
19675a |
echo
|
|
Tomáš Mráz |
19675a |
@@ -103,17 +107,30 @@
|
|
Tomáš Mráz |
19675a |
|
|
Tomáš Mráz |
19675a |
stop()
|
|
Tomáš Mráz |
19675a |
{
|
|
Tomáš Mráz |
19675a |
- echo -n $"Stopping $prog:"
|
|
Tomáš Mráz |
19675a |
- killproc $SSHD -TERM
|
|
Tomáš Mráz |
19675a |
+ echo -n $"Stopping $prog: "
|
|
Tomáš Mráz |
19675a |
+ if [ -n "`pidfileofproc $SSHD`" ] ; then
|
|
Tomáš Mráz |
19675a |
+ killproc $SSHD
|
|
Tomáš Mráz |
19675a |
+ else
|
|
Tomáš Mráz |
19675a |
+ failure $"Stopping $prog"
|
|
Tomáš Mráz |
19675a |
+ fi
|
|
Tomáš Mráz |
19675a |
RETVAL=$?
|
|
Tomáš Mráz |
19675a |
+ # if we are in halt or reboot runlevel kill all running sessions
|
|
Tomáš Mráz |
19675a |
+ # so the TCP connections are closed cleanly
|
|
Tomáš Mráz |
19675a |
+ if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
|
|
Tomáš Mráz |
19675a |
+ killall $prog 2>/dev/null
|
|
Tomáš Mráz |
19675a |
+ fi
|
|
Tomáš Mráz |
19675a |
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/sshd
|
|
Tomáš Mráz |
19675a |
echo
|
|
Tomáš Mráz |
19675a |
}
|
|
Tomáš Mráz |
19675a |
|
|
Tomáš Mráz |
19675a |
reload()
|
|
Tomáš Mráz |
19675a |
{
|
|
Tomáš Mráz |
19675a |
- echo -n $"Reloading $prog:"
|
|
Tomáš Mráz |
19675a |
- killproc $SSHD -HUP
|
|
Tomáš Mráz |
19675a |
+ echo -n $"Reloading $prog: "
|
|
Tomáš Mráz |
19675a |
+ if [ -n "`pidfileofproc $SSHD`" ] ; then
|
|
Tomáš Mráz |
19675a |
+ killproc $SSHD -HUP
|
|
Tomáš Mráz |
19675a |
+ else
|
|
Tomáš Mráz |
19675a |
+ failure $"Reloading $prog"
|
|
Tomáš Mráz |
19675a |
+ fi
|
|
Tomáš Mráz |
19675a |
RETVAL=$?
|
|
Tomáš Mráz |
19675a |
echo
|
|
Tomáš Mráz |
19675a |
}
|