diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | contrib/redhat/openssh.spec | 1 | ||||
-rwxr-xr-x | contrib/redhat/sshd.init | 48 | ||||
-rwxr-xr-x | contrib/redhat/sshd.init-5.x | 62 |
4 files changed, 43 insertions, 72 deletions
@@ -5,6 +5,8 @@ | |||
5 | - markus@cvs.openbsd.org 2001/02/23 15:37:45 | 5 | - markus@cvs.openbsd.org 2001/02/23 15:37:45 |
6 | [session.c] | 6 | [session.c] |
7 | handle SSH_PROTOFLAG_SCREEN_NUMBER for buggy clients | 7 | handle SSH_PROTOFLAG_SCREEN_NUMBER for buggy clients |
8 | - (bal) sshd.init support for all Redhat release. Patch by Jim Knoble | ||
9 | <jmknoble@jmknoble.cx> | ||
8 | 10 | ||
9 | 20010226 | 11 | 20010226 |
10 | - (bal) Fixed bsd-snprinf.c so it now honors 'BROKEN_SNPRINTF' again. | 12 | - (bal) Fixed bsd-snprinf.c so it now honors 'BROKEN_SNPRINTF' again. |
@@ -4139,4 +4141,4 @@ | |||
4139 | - Wrote replacements for strlcpy and mkdtemp | 4141 | - Wrote replacements for strlcpy and mkdtemp |
4140 | - Released 1.0pre1 | 4142 | - Released 1.0pre1 |
4141 | 4143 | ||
4142 | $Id: ChangeLog,v 1.825 2001/02/26 20:13:32 mouring Exp $ | 4144 | $Id: ChangeLog,v 1.826 2001/02/26 20:38:53 mouring Exp $ |
diff --git a/contrib/redhat/openssh.spec b/contrib/redhat/openssh.spec index f23468de2..9583a1ce7 100644 --- a/contrib/redhat/openssh.spec +++ b/contrib/redhat/openssh.spec | |||
@@ -60,7 +60,6 @@ Summary: OpenSSH Secure Shell protocol server (sshd) | |||
60 | Group: System Environment/Daemons | 60 | Group: System Environment/Daemons |
61 | Obsoletes: ssh-server | 61 | Obsoletes: ssh-server |
62 | PreReq: openssh = %{version}-%{release}, chkconfig >= 0.9 | 62 | PreReq: openssh = %{version}-%{release}, chkconfig >= 0.9 |
63 | Requires: initscripts >= 4.16 | ||
64 | %if %{redhat7} | 63 | %if %{redhat7} |
65 | Requires: /etc/pam.d/system-auth | 64 | Requires: /etc/pam.d/system-auth |
66 | %endif | 65 | %endif |
diff --git a/contrib/redhat/sshd.init b/contrib/redhat/sshd.init index a4df64276..c9c1c7bfe 100755 --- a/contrib/redhat/sshd.init +++ b/contrib/redhat/sshd.init | |||
@@ -23,14 +23,46 @@ RSA1_KEY=/etc/ssh/ssh_host_key | |||
23 | RSA_KEY=/etc/ssh/ssh_host_rsa_key | 23 | RSA_KEY=/etc/ssh/ssh_host_rsa_key |
24 | DSA_KEY=/etc/ssh/ssh_host_dsa_key | 24 | DSA_KEY=/etc/ssh/ssh_host_dsa_key |
25 | PID_FILE=/var/run/sshd.pid | 25 | PID_FILE=/var/run/sshd.pid |
26 | my_success() { | ||
27 | local msg | ||
28 | if [ $# -gt 1 ]; then | ||
29 | msg="$2" | ||
30 | else | ||
31 | msg="done" | ||
32 | fi | ||
33 | case "`type -type success`" in | ||
34 | function) | ||
35 | success "$1" | ||
36 | ;; | ||
37 | *) | ||
38 | echo -n "${msg}" | ||
39 | ;; | ||
40 | esac | ||
41 | } | ||
42 | my_failure() { | ||
43 | local msg | ||
44 | if [ $# -gt 1 ]; then | ||
45 | msg="$2" | ||
46 | else | ||
47 | msg="FAILED" | ||
48 | fi | ||
49 | case "`type -type failure`" in | ||
50 | function) | ||
51 | failure "$1" | ||
52 | ;; | ||
53 | *) | ||
54 | echo -n "${msg}" | ||
55 | ;; | ||
56 | esac | ||
57 | } | ||
26 | do_rsa1_keygen() { | 58 | do_rsa1_keygen() { |
27 | if ! test -f $RSA1_KEY ; then | 59 | if ! test -f $RSA1_KEY ; then |
28 | echo -n "Generating SSH1 RSA host key: " | 60 | echo -n "Generating SSH1 RSA host key: " |
29 | if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then | 61 | if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then |
30 | success "RSA1 key generation" | 62 | my_success "RSA1 key generation" |
31 | echo | 63 | echo |
32 | else | 64 | else |
33 | failure "RSA1 key generation" | 65 | my_failure "RSA1 key generation" |
34 | echo | 66 | echo |
35 | exit 1 | 67 | exit 1 |
36 | fi | 68 | fi |
@@ -40,10 +72,10 @@ do_rsa_keygen() { | |||
40 | if ! test -f $RSA_KEY ; then | 72 | if ! test -f $RSA_KEY ; then |
41 | echo -n "Generating SSH2 RSA host key: " | 73 | echo -n "Generating SSH2 RSA host key: " |
42 | if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then | 74 | if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then |
43 | success "RSA key generation" | 75 | my_success "RSA key generation" |
44 | echo | 76 | echo |
45 | else | 77 | else |
46 | failure "RSA key generation" | 78 | my_failure "RSA key generation" |
47 | echo | 79 | echo |
48 | exit 1 | 80 | exit 1 |
49 | fi | 81 | fi |
@@ -53,10 +85,10 @@ do_dsa_keygen() { | |||
53 | if ! test -f $DSA_KEY ; then | 85 | if ! test -f $DSA_KEY ; then |
54 | echo -n "Generating SSH2 DSA host key: " | 86 | echo -n "Generating SSH2 DSA host key: " |
55 | if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then | 87 | if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then |
56 | success "DSA key generation" | 88 | my_success "DSA key generation" |
57 | echo | 89 | echo |
58 | else | 90 | else |
59 | failure "DSA key generation" | 91 | my_failure "DSA key generation" |
60 | echo | 92 | echo |
61 | exit 1 | 93 | exit 1 |
62 | fi | 94 | fi |
@@ -75,10 +107,10 @@ case "$1" in | |||
75 | sshd | 107 | sshd |
76 | RETVAL=$? | 108 | RETVAL=$? |
77 | if [ "$RETVAL" = "0" ] ; then | 109 | if [ "$RETVAL" = "0" ] ; then |
78 | success "sshd startup" | 110 | my_success "sshd startup" "sshd" |
79 | touch /var/lock/subsys/sshd | 111 | touch /var/lock/subsys/sshd |
80 | else | 112 | else |
81 | failure "sshd startup" | 113 | my_failure "sshd startup" "" |
82 | fi | 114 | fi |
83 | fi | 115 | fi |
84 | echo | 116 | echo |
diff --git a/contrib/redhat/sshd.init-5.x b/contrib/redhat/sshd.init-5.x deleted file mode 100755 index 51ded9338..000000000 --- a/contrib/redhat/sshd.init-5.x +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Init file for OpenSSH server daemon | ||
4 | # | ||
5 | # chkconfig: 2345 55 25 | ||
6 | # description: OpenSSH server daemon | ||
7 | # | ||
8 | # processname: sshd | ||
9 | # config: /etc/ssh/ssh_host_key | ||
10 | # config: /etc/ssh/ssh_host_key.pub | ||
11 | # config: /etc/ssh/ssh_random_seed | ||
12 | # config: /etc/ssh/sshd_config | ||
13 | # pidfile: /var/run/sshd.pid | ||
14 | |||
15 | # source function library | ||
16 | . /etc/rc.d/init.d/functions | ||
17 | |||
18 | RETVAL=0 | ||
19 | |||
20 | case "$1" in | ||
21 | start) | ||
22 | echo -n "Starting sshd: " | ||
23 | if [ ! -f /var/run/sshd.pid ] ; then | ||
24 | case "`type -type success`" in | ||
25 | function) | ||
26 | /usr/sbin/sshd && success "sshd startup" || failure "sshd startup" | ||
27 | RETVAL=$? | ||
28 | ;; | ||
29 | *) | ||
30 | /usr/sbin/sshd && echo -n "sshd " | ||
31 | RETVAL=$? | ||
32 | ;; | ||
33 | esac | ||
34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd | ||
35 | fi | ||
36 | echo | ||
37 | ;; | ||
38 | stop) | ||
39 | echo -n "Shutting down sshd: " | ||
40 | if [ -f /var/run/sshd.pid ] ; then | ||
41 | killproc sshd | ||
42 | RETVAL=$? | ||
43 | fi | ||
44 | echo | ||
45 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd | ||
46 | ;; | ||
47 | restart) | ||
48 | $0 stop | ||
49 | $0 start | ||
50 | RETVAL=$? | ||
51 | ;; | ||
52 | status) | ||
53 | status sshd | ||
54 | RETVAL=$? | ||
55 | ;; | ||
56 | *) | ||
57 | echo "Usage: sshd {start|stop|restart|status}" | ||
58 | exit 1 | ||
59 | ;; | ||
60 | esac | ||
61 | |||
62 | exit $RETVAL | ||