summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-06-12 18:36:09 +0000
committerColin Watson <cjwatson@debian.org>2007-06-12 18:36:09 +0000
commit135aee3c2149266f5fe1fef16e8fa81c35b8e751 (patch)
tree2c50d4ea8c7c6e68092bb4d68c9c5471917e1ef7 /debian
parent60c59adc0fce137951c09a259b1c12aa0c1ee2f9 (diff)
* Emit a slightly more informative message from the init script if
/dev/null has somehow become not a character device (closes: #369964).
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog2
-rw-r--r--debian/openssh-server.init14
2 files changed, 16 insertions, 0 deletions
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
60 Christian Perrier; closes: #389038). 60 Christian Perrier; closes: #389038).
61 * Move init script start links to S16, and remove stop links altogether 61 * Move init script start links to S16, and remove stop links altogether
62 (closes: #122188). 62 (closes: #122188).
63 * Emit a slightly more informative message from the init script if
64 /dev/null has somehow become not a character device (closes: #369964).
63 65
64 -- Colin Watson <cjwatson@ubuntu.com> Tue, 12 Jun 2007 14:31:01 +0100 66 -- Colin Watson <cjwatson@ubuntu.com> Tue, 12 Jun 2007 14:31:01 +0100
65 67
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() {
39 fi 39 fi
40} 40}
41 41
42check_dev_null() {
43 if [ ! -c /dev/null ]; then
44 if [ "$1" = log_end_msg ]; then
45 log_end_msg 1 || true
46 fi
47 if ! run_by_init; then
48 log_action_msg "/dev/null is not a character device!"
49 fi
50 exit 1
51 fi
52}
53
42check_privsep_dir() { 54check_privsep_dir() {
43 # Create the PrivSep empty dir if necessary 55 # Create the PrivSep empty dir if necessary
44 if [ ! -d /var/run/sshd ]; then 56 if [ ! -d /var/run/sshd ]; then
@@ -58,6 +70,7 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
58case "$1" in 70case "$1" in
59 start) 71 start)
60 check_for_no_start 72 check_for_no_start
73 check_dev_null
61 log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" 74 log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd"
62 check_privsep_dir 75 check_privsep_dir
63 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then 76 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
92 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" 105 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd"
93 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid 106 start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /var/run/sshd.pid
94 check_for_no_start log_end_msg 107 check_for_no_start log_end_msg
108 check_dev_null log_end_msg
95 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then 109 if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then
96 log_end_msg 0 110 log_end_msg 0
97 else 111 else