summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebian/agent-launch8
-rw-r--r--debian/changelog4
-rwxr-xr-xdebian/openssh-client.install5
-rw-r--r--debian/openssh-server.maintscript1
-rw-r--r--debian/openssh-server.postinst7
-rw-r--r--debian/openssh-server.ssh.init12
-rw-r--r--debian/openssh-server.ssh.upstart29
-rw-r--r--debian/ssh-agent.user-session.upstart7
8 files changed, 6 insertions, 67 deletions
diff --git a/debian/agent-launch b/debian/agent-launch
index 79c75a50b..f3cbfaef8 100755
--- a/debian/agent-launch
+++ b/debian/agent-launch
@@ -1,5 +1,5 @@
1#!/bin/sh 1#!/bin/sh
2# helper script for launching ssh-agent, used by systemd unit and upstart job 2# helper script for launching ssh-agent, used by systemd unit
3set -e 3set -e
4 4
5if [ ! -d "$XDG_RUNTIME_DIR" ]; then 5if [ ! -d "$XDG_RUNTIME_DIR" ]; then
@@ -11,17 +11,11 @@ if [ "$1" = start ]; then
11 if [ -z "$SSH_AUTH_SOCK" ] && grep -s -q '^use-ssh-agent$' /etc/X11/Xsession.options; then 11 if [ -z "$SSH_AUTH_SOCK" ] && grep -s -q '^use-ssh-agent$' /etc/X11/Xsession.options; then
12 S="$XDG_RUNTIME_DIR/openssh_agent" 12 S="$XDG_RUNTIME_DIR/openssh_agent"
13 dbus-update-activation-environment --verbose --systemd SSH_AUTH_SOCK=$S SSH_AGENT_LAUNCHER=openssh 13 dbus-update-activation-environment --verbose --systemd SSH_AUTH_SOCK=$S SSH_AGENT_LAUNCHER=openssh
14 if [ "$UPSTART_SESSION" ] && type initctl >/dev/null 2>&1; then
15 initctl set-env --global SSH_AUTH_SOCK=$S
16 fi
17 exec ssh-agent -D -a $S 14 exec ssh-agent -D -a $S
18 fi 15 fi
19elif [ "$1" = stop ]; then 16elif [ "$1" = stop ]; then
20 if [ "$SSH_AGENT_LAUNCHER" = openssh ]; then 17 if [ "$SSH_AGENT_LAUNCHER" = openssh ]; then
21 dbus-update-activation-environment --systemd SSH_AUTH_SOCK= 18 dbus-update-activation-environment --systemd SSH_AUTH_SOCK=
22 if [ "$UPSTART_SESSION" ] && type initctl >/dev/null 2>&1; then
23 initctl unset-env --global SSH_AUTH_SOCK
24 fi
25 fi 19 fi
26else 20else
27 echo "Unknown command $1" >&2 21 echo "Unknown command $1" >&2
diff --git a/debian/changelog b/debian/changelog
index 153a8f7e5..0aed26ad5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,14 @@
1openssh (1:7.5p1-6) UNRELEASED; urgency=medium 1openssh (1:7.5p1-6) UNRELEASED; urgency=medium
2 2
3 [ Colin Watson ]
3 * Test configuration before starting or reloading sshd under systemd 4 * Test configuration before starting or reloading sshd under systemd
4 (closes: #865770). 5 (closes: #865770).
5 * Create /run/sshd under systemd using RuntimeDirectory rather than 6 * Create /run/sshd under systemd using RuntimeDirectory rather than
6 tmpfiles.d (thanks, Dmitry Smirnov; closes: #864190). 7 tmpfiles.d (thanks, Dmitry Smirnov; closes: #864190).
7 8
9 [ Dimitri John Ledkov ]
10 * Drop upstart system and user jobs.
11
8 -- Colin Watson <cjwatson@debian.org> Mon, 26 Jun 2017 10:09:28 +0100 12 -- Colin Watson <cjwatson@debian.org> Mon, 26 Jun 2017 10:09:28 +0100
9 13
10openssh (1:7.5p1-5) unstable; urgency=medium 14openssh (1:7.5p1-5) unstable; urgency=medium
diff --git a/debian/openssh-client.install b/debian/openssh-client.install
index b8b798d91..838f98116 100755
--- a/debian/openssh-client.install
+++ b/debian/openssh-client.install
@@ -32,10 +32,5 @@ debian/agent-launch usr/lib/openssh
32# yet. 32# yet.
33debian/openssh-client.apport => usr/share/apport/package-hooks/openssh-client.py 33debian/openssh-client.apport => usr/share/apport/package-hooks/openssh-client.py
34 34
35# Upstart user job (only used under user sessions).
36debian/ssh-agent.user-session.upstart => usr/share/upstart/sessions/ssh-agent.conf
37
38# systemd user unit (only used under sessions) 35# systemd user unit (only used under sessions)
39debian/systemd/ssh-agent.service usr/lib/systemd/user 36debian/systemd/ssh-agent.service usr/lib/systemd/user
40# disable above upstart job when running the systemd user unit
41debian/systemd/ssh-agent.override usr/share/upstart/systemd-session/upstart
diff --git a/debian/openssh-server.maintscript b/debian/openssh-server.maintscript
index f9e3c4d53..0e44b2889 100644
--- a/debian/openssh-server.maintscript
+++ b/debian/openssh-server.maintscript
@@ -1 +1,2 @@
1mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd 1:4.7p1-4~ 1mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd 1:4.7p1-4~
2rm_conffile /etc/init/ssh.conf 1:7.5p1-6~ openssh-server
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index 8b554ee1e..94a47da20 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -128,13 +128,6 @@ if [ "$action" = configure ]; then
128 if dpkg --compare-versions "$2" lt-nl 1:5.5p1-6; then 128 if dpkg --compare-versions "$2" lt-nl 1:5.5p1-6; then
129 rm -f /run/sshd/.placeholder 129 rm -f /run/sshd/.placeholder
130 fi 130 fi
131 if dpkg --compare-versions "$2" lt-nl 1:6.2p2-3 && \
132 which initctl >/dev/null && initctl version 2>/dev/null | grep -q upstart && \
133 ! status ssh 2>/dev/null | grep -q ' start/'; then
134 # We must stop the sysvinit-controlled sshd before we can
135 # restart it under Upstart.
136 start-stop-daemon --stop --quiet --oknodo --pidfile /run/sshd.pid || true
137 fi
138 if dpkg --compare-versions "$2" lt-nl 1:6.5p1-2 && \ 131 if dpkg --compare-versions "$2" lt-nl 1:6.5p1-2 && \
139 deb-systemd-helper debian-installed ssh.socket && \ 132 deb-systemd-helper debian-installed ssh.socket && \
140 deb-systemd-helper --quiet was-enabled ssh.service && \ 133 deb-systemd-helper --quiet was-enabled ssh.service && \
diff --git a/debian/openssh-server.ssh.init b/debian/openssh-server.ssh.init
index 70a6c38f2..f25000883 100644
--- a/debian/openssh-server.ssh.init
+++ b/debian/openssh-server.ssh.init
@@ -33,12 +33,6 @@ run_by_init() {
33 ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ] 33 ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
34} 34}
35 35
36check_for_upstart() {
37 if init_is_upstart; then
38 exit $1
39 fi
40}
41
42check_for_no_start() { 36check_for_no_start() {
43 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists 37 # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
44 if [ -e /etc/ssh/sshd_not_to_be_run ]; then 38 if [ -e /etc/ssh/sshd_not_to_be_run ]; then
@@ -82,7 +76,6 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
82 76
83case "$1" in 77case "$1" in
84 start) 78 start)
85 check_for_upstart 1
86 check_privsep_dir 79 check_privsep_dir
87 check_for_no_start 80 check_for_no_start
88 check_dev_null 81 check_dev_null
@@ -94,7 +87,6 @@ case "$1" in
94 fi 87 fi
95 ;; 88 ;;
96 stop) 89 stop)
97 check_for_upstart 0
98 log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true 90 log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true
99 if start-stop-daemon --stop --quiet --oknodo --pidfile /run/sshd.pid; then 91 if start-stop-daemon --stop --quiet --oknodo --pidfile /run/sshd.pid; then
100 log_end_msg 0 || true 92 log_end_msg 0 || true
@@ -104,7 +96,6 @@ case "$1" in
104 ;; 96 ;;
105 97
106 reload|force-reload) 98 reload|force-reload)
107 check_for_upstart 1
108 check_for_no_start 99 check_for_no_start
109 check_config 100 check_config
110 log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd" || true 101 log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd" || true
@@ -116,7 +107,6 @@ case "$1" in
116 ;; 107 ;;
117 108
118 restart) 109 restart)
119 check_for_upstart 1
120 check_privsep_dir 110 check_privsep_dir
121 check_config 111 check_config
122 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true 112 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true
@@ -131,7 +121,6 @@ case "$1" in
131 ;; 121 ;;
132 122
133 try-restart) 123 try-restart)
134 check_for_upstart 1
135 check_privsep_dir 124 check_privsep_dir
136 check_config 125 check_config
137 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true 126 log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true
@@ -162,7 +151,6 @@ case "$1" in
162 ;; 151 ;;
163 152
164 status) 153 status)
165 check_for_upstart 1
166 status_of_proc -p /run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $? 154 status_of_proc -p /run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $?
167 ;; 155 ;;
168 156
diff --git a/debian/openssh-server.ssh.upstart b/debian/openssh-server.ssh.upstart
deleted file mode 100644
index 9b0e95450..000000000
--- a/debian/openssh-server.ssh.upstart
+++ /dev/null
@@ -1,29 +0,0 @@
1# ssh - OpenBSD Secure Shell server
2#
3# The OpenSSH server provides secure shell access to the system.
4
5description "OpenSSH server"
6
7start on runlevel [2345]
8stop on runlevel [!2345]
9
10respawn
11respawn limit 10 5
12umask 022
13
14env SSH_SIGSTOP=1
15expect stop
16
17# 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
18console none
19
20pre-start script
21 test -x /usr/sbin/sshd || { stop; exit 0; }
22 test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
23
24 mkdir -p -m0755 /run/sshd
25end script
26
27# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
28# 'exec' line here instead
29exec /usr/sbin/sshd -D
diff --git a/debian/ssh-agent.user-session.upstart b/debian/ssh-agent.user-session.upstart
deleted file mode 100644
index 672d2a0de..000000000
--- a/debian/ssh-agent.user-session.upstart
+++ /dev/null
@@ -1,7 +0,0 @@
1description "SSH Agent"
2author "Stéphane Graber <stgraber@ubuntu.com>"
3
4start on starting xsession-init
5
6exec /usr/lib/openssh/agent-launch start
7post-stop exec /usr/lib/openssh/agent-launch stop