From 135aee3c2149266f5fe1fef16e8fa81c35b8e751 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 12 Jun 2007 18:36:09 +0000 Subject: * Emit a slightly more informative message from the init script if /dev/null has somehow become not a character device (closes: #369964). --- debian/changelog | 2 ++ debian/openssh-server.init | 14 ++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e07aa8f25..12ebb566e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -60,6 +60,8 @@ openssh (1:4.6p1-1) UNRELEASED; urgency=low Christian Perrier; closes: #389038). * Move init script start links to S16, and remove stop links altogether (closes: #122188). + * Emit a slightly more informative message from the init script if + /dev/null has somehow become not a character device (closes: #369964). -- Colin Watson Tue, 12 Jun 2007 14:31:01 +0100 diff --git a/debian/openssh-server.init b/debian/openssh-server.init index 6fd04bb74..72ce5c179 100644 --- a/debian/openssh-server.init +++ b/debian/openssh-server.init @@ -39,6 +39,18 @@ check_for_no_start() { fi } +check_dev_null() { + if [ ! -c /dev/null ]; then + if [ "$1" = log_end_msg ]; then + log_end_msg 1 || true + fi + if ! run_by_init; then + log_action_msg "/dev/null is not a character device!" + fi + exit 1 + fi +} + check_privsep_dir() { # Create the PrivSep empty dir if necessary if [ ! -d /var/run/sshd ]; then @@ -58,6 +70,7 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" case "$1" in start) check_for_no_start + check_dev_null log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" check_privsep_dir if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then @@ -92,6 +105,7 @@ case "$1" in log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" 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 else -- cgit v1.2.3