summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-06-13 16:30:32 +0000
committerColin Watson <cjwatson@debian.org>2007-06-13 16:30:32 +0000
commita4d3beb36250111e9b1e5991e8b79a794022c8f0 (patch)
tree99258eacc50b113104687641fc21970e0c1af7f8
parent2b8fc49f1063b194eefdcc8df011a3c2ce79b7e6 (diff)
* Add try-restart action to init script.
-rw-r--r--debian/changelog1
-rw-r--r--debian/openssh-server.init34
2 files changed, 34 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 677d4d7da..7a9dcc970 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ openssh (1:4.6p1-2) UNRELEASED; urgency=low
9 terminal" message at loglevels QUIET and SILENT (closes: #366814). 9 terminal" message at loglevels QUIET and SILENT (closes: #366814).
10 * Document the SILENT loglevel in sftp-server(8), ssh_config(5), and 10 * Document the SILENT loglevel in sftp-server(8), ssh_config(5), and
11 sshd_config(5). 11 sshd_config(5).
12 * Add try-restart action to init script.
12 13
13 -- Colin Watson <cjwatson@debian.org> Wed, 13 Jun 2007 00:56:45 +0100 14 -- Colin Watson <cjwatson@debian.org> Wed, 13 Jun 2007 00:56:45 +0100
14 15
diff --git a/debian/openssh-server.init b/debian/openssh-server.init
index ff6c078ad..59f45edd0 100644
--- a/debian/openssh-server.init
+++ b/debian/openssh-server.init
@@ -114,8 +114,40 @@ case "$1" in
114 fi 114 fi
115 ;; 115 ;;
116 116
117 try-restart)
118 check_privsep_dir
119 check_config
120 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
121 set +e
122 start-stop-daemon --stop --quiet --retry 30 --pidfile /var/run/sshd.pid
123 RET="$?"
124 set -e
125 case $RET in
126 0)
127 # old daemon stopped
128 check_for_no_start log_end_msg
129 check_dev_null log_end_msg
130 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
131 log_end_msg 0
132 else
133 log_end_msg 1
134 fi
135 ;;
136 1)
137 # daemon not running
138 log_progress_msg "(not running)"
139 log_end_msg 0
140 ;;
141 *)
142 # failed to stop
143 log_progress_msg "(failed to stop)"
144 log_end_msg 1
145 ;;
146 esac
147 ;;
148
117 *) 149 *)
118 log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart}" 150 log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart}"
119 exit 1 151 exit 1
120esac 152esac
121 153