From 9e314609754e89aaee74e2eff28fd9f97b7e7a68 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 24 Feb 2012 08:29:10 +0000 Subject: Ignore errors writing to console in init script (closes: #546743). --- debian/changelog | 1 + debian/openssh-server.ssh.init | 46 +++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 23 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5d7c0529e..63bc8f151 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ openssh (1:5.9p1-3) UNRELEASED; urgency=low * debconf template translations: - Update Polish (thanks, Michał Kułach; closes: #659829). + * Ignore errors writing to console in init script (closes: #546743). -- Colin Watson Tue, 14 Feb 2012 11:01:44 +0000 diff --git a/debian/openssh-server.ssh.init b/debian/openssh-server.ssh.init index 62bcc21d4..a069f3ead 100644 --- a/debian/openssh-server.ssh.init +++ b/debian/openssh-server.ssh.init @@ -37,10 +37,10 @@ check_for_no_start() { # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists if [ -e /etc/ssh/sshd_not_to_be_run ]; then if [ "$1" = log_end_msg ]; then - log_end_msg 0 + log_end_msg 0 || true fi if ! run_by_init; then - log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" + log_action_msg "OpenBSD Secure Shell server not in use (/etc/ssh/sshd_not_to_be_run)" || true fi exit 0 fi @@ -52,7 +52,7 @@ check_dev_null() { log_end_msg 1 || true fi if ! run_by_init; then - log_action_msg "/dev/null is not a character device!" + log_action_msg "/dev/null is not a character device!" || true fi exit 1 fi @@ -79,51 +79,51 @@ case "$1" in check_privsep_dir check_for_no_start check_dev_null - log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" + log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" || true if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then - log_end_msg 0 + log_end_msg 0 || true else - log_end_msg 1 + log_end_msg 1 || true fi ;; stop) - log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" + log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/sshd.pid; then - log_end_msg 0 + log_end_msg 0 || true else - log_end_msg 1 + log_end_msg 1 || true fi ;; reload|force-reload) check_for_no_start check_config - log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd" + log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd" || true if start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd; then - log_end_msg 0 + log_end_msg 0 || true else - log_end_msg 1 + log_end_msg 1 || true fi ;; restart) check_privsep_dir check_config - log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" + log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid check_for_no_start log_end_msg check_dev_null log_end_msg if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then - log_end_msg 0 + log_end_msg 0 || true else - log_end_msg 1 + log_end_msg 1 || true fi ;; try-restart) check_privsep_dir check_config - log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" + log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true set +e start-stop-daemon --stop --quiet --retry 30 --pidfile /var/run/sshd.pid RET="$?" @@ -134,20 +134,20 @@ case "$1" in check_for_no_start log_end_msg check_dev_null log_end_msg if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then - log_end_msg 0 + log_end_msg 0 || true else - log_end_msg 1 + log_end_msg 1 || true fi ;; 1) # daemon not running - log_progress_msg "(not running)" - log_end_msg 0 + log_progress_msg "(not running)" || true + log_end_msg 0 || true ;; *) # failed to stop - log_progress_msg "(failed to stop)" - log_end_msg 1 + log_progress_msg "(failed to stop)" || true + log_end_msg 1 || true ;; esac ;; @@ -157,7 +157,7 @@ case "$1" in ;; *) - log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart|status}" + log_action_msg "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|try-restart|status}" || true exit 1 esac -- cgit v1.2.3