Package: openssh-server
Version: 1:7.5p1-5
Severity: normal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dear Maintainer,

Please drop upstart integration from openssh:

* Patch to drop upstart jobs
* Patch to fix up build

* Please rebase git dpm patches, and drop doc-upstart.patch

Regards,

Dimitri.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJZmz34AAoJEMrC2LnNLKX5mJUH/iD0T6B6i6OWBuEEUF/m+7/H
adrH/BAA4oqCGOqmCsab4z95aE6NB/gDErW1jkOC7oOAAErfr9R/INJD1JENonzi
7c1fGOGgNK1b9+3Cbhs2In0QgTqloeJpamgqp3/6uTop/mWwNeDGD9dCm22K2Smw
boPgvoh2lqUMzm13kcBYOMi6e/zgHgkE0GqDiDAWCaMEHI1Tb+D+A4D8U6C5FqAB
kRcm0ye9Q/TcJ8ikM7BOtYNZNshALOi1XY923tlf85G+pr4xl+J2L9nvv3heUWDC
qWTNd/kGyne2wTWQWiLP4/t+3mpb1q07ClRJNGb5hjSgg60nJwjbDt2735riRX0=
=q/4M
-----END PGP SIGNATURE-----
>From 575d6aa8c62e7d9f873d0c3fe66d6a51db69dd80 Mon Sep 17 00:00:00 2001
From: Dimitri John Ledkov <x...@ubuntu.com>
Date: Mon, 21 Aug 2017 12:48:31 +0100
Subject: [PATCH 1/2] Drop upstart system and user jobs.

---
 debian/agent-launch                   |  8 +-------
 debian/changelog                      |  4 ++++
 debian/openssh-client.install         |  5 -----
 debian/openssh-server.maintscript     |  1 +
 debian/openssh-server.postinst        |  7 -------
 debian/openssh-server.ssh.init        | 12 ------------
 debian/openssh-server.ssh.upstart     | 29 -----------------------------
 debian/ssh-agent.user-session.upstart |  7 -------
 8 files changed, 6 insertions(+), 67 deletions(-)
 delete mode 100644 debian/openssh-server.ssh.upstart
 delete mode 100644 debian/ssh-agent.user-session.upstart

diff --git a/debian/agent-launch b/debian/agent-launch
index 79c75a5..f3cbfae 100755
--- a/debian/agent-launch
+++ b/debian/agent-launch
@@ -1,5 +1,5 @@
 #!/bin/sh
-# helper script for launching ssh-agent, used by systemd unit and upstart job
+# helper script for launching ssh-agent, used by systemd unit
 set -e
 
 if [ ! -d "$XDG_RUNTIME_DIR" ]; then
@@ -11,17 +11,11 @@ if [ "$1" = start ]; then
     if [ -z "$SSH_AUTH_SOCK" ] && grep -s -q '^use-ssh-agent$' /etc/X11/Xsession.options; then
         S="$XDG_RUNTIME_DIR/openssh_agent"
         dbus-update-activation-environment --verbose --systemd SSH_AUTH_SOCK=$S SSH_AGENT_LAUNCHER=openssh
-        if [ "$UPSTART_SESSION" ] && type initctl >/dev/null 2>&1; then
-            initctl set-env --global SSH_AUTH_SOCK=$S
-        fi
         exec ssh-agent -D -a $S
     fi
 elif [ "$1" = stop ]; then
     if [ "$SSH_AGENT_LAUNCHER" = openssh ]; then
         dbus-update-activation-environment --systemd  SSH_AUTH_SOCK=
-        if [ "$UPSTART_SESSION" ] && type initctl >/dev/null 2>&1; then
-            initctl unset-env --global SSH_AUTH_SOCK
-        fi
     fi
 else
     echo "Unknown command $1" >&2
diff --git a/debian/changelog b/debian/changelog
index 153a8f7..0aed26a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,14 @@
 openssh (1:7.5p1-6) UNRELEASED; urgency=medium
 
+  [ Colin Watson ]
   * Test configuration before starting or reloading sshd under systemd
     (closes: #865770).
   * Create /run/sshd under systemd using RuntimeDirectory rather than
     tmpfiles.d (thanks, Dmitry Smirnov; closes: #864190).
 
+  [ Dimitri John Ledkov ]
+  * Drop upstart system and user jobs.
+
  -- Colin Watson <cjwat...@debian.org>  Mon, 26 Jun 2017 10:09:28 +0100
 
 openssh (1:7.5p1-5) unstable; urgency=medium
diff --git a/debian/openssh-client.install b/debian/openssh-client.install
index b8b798d..838f981 100755
--- a/debian/openssh-client.install
+++ b/debian/openssh-client.install
@@ -32,10 +32,5 @@ debian/agent-launch usr/lib/openssh
 # yet.
 debian/openssh-client.apport => usr/share/apport/package-hooks/openssh-client.py
 
-# Upstart user job (only used under user sessions).
-debian/ssh-agent.user-session.upstart => usr/share/upstart/sessions/ssh-agent.conf
-
 # systemd user unit (only used under sessions)
 debian/systemd/ssh-agent.service usr/lib/systemd/user
-# disable above upstart job when running the systemd user unit
-debian/systemd/ssh-agent.override usr/share/upstart/systemd-session/upstart
diff --git a/debian/openssh-server.maintscript b/debian/openssh-server.maintscript
index f9e3c4d..0e44b28 100644
--- a/debian/openssh-server.maintscript
+++ b/debian/openssh-server.maintscript
@@ -1 +1,2 @@
 mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd 1:4.7p1-4~
+rm_conffile /etc/init/ssh.conf 1:7.5p1-6~ openssh-server
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst
index 8b554ee..94a47da 100644
--- a/debian/openssh-server.postinst
+++ b/debian/openssh-server.postinst
@@ -128,13 +128,6 @@ if [ "$action" = configure ]; then
 	if dpkg --compare-versions "$2" lt-nl 1:5.5p1-6; then
 	    rm -f /run/sshd/.placeholder
 	fi
-	if dpkg --compare-versions "$2" lt-nl 1:6.2p2-3 && \
-	   which initctl >/dev/null && initctl version 2>/dev/null | grep -q upstart && \
-	   ! status ssh 2>/dev/null | grep -q ' start/'; then
-	    # We must stop the sysvinit-controlled sshd before we can
-	    # restart it under Upstart.
-	    start-stop-daemon --stop --quiet --oknodo --pidfile /run/sshd.pid || true
-	fi
 	if dpkg --compare-versions "$2" lt-nl 1:6.5p1-2 && \
 	   deb-systemd-helper debian-installed ssh.socket && \
 	   deb-systemd-helper --quiet was-enabled ssh.service && \
diff --git a/debian/openssh-server.ssh.init b/debian/openssh-server.ssh.init
index 70a6c38..f250008 100644
--- a/debian/openssh-server.ssh.init
+++ b/debian/openssh-server.ssh.init
@@ -33,12 +33,6 @@ run_by_init() {
     ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
 }
 
-check_for_upstart() {
-    if init_is_upstart; then
-	exit $1
-    fi
-}
-
 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 
@@ -82,7 +76,6 @@ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
 
 case "$1" in
   start)
-	check_for_upstart 1
 	check_privsep_dir
 	check_for_no_start
 	check_dev_null
@@ -94,7 +87,6 @@ case "$1" in
 	fi
 	;;
   stop)
-	check_for_upstart 0
 	log_daemon_msg "Stopping OpenBSD Secure Shell server" "sshd" || true
 	if start-stop-daemon --stop --quiet --oknodo --pidfile /run/sshd.pid; then
 	    log_end_msg 0 || true
@@ -104,7 +96,6 @@ case "$1" in
 	;;
 
   reload|force-reload)
-	check_for_upstart 1
 	check_for_no_start
 	check_config
 	log_daemon_msg "Reloading OpenBSD Secure Shell server's configuration" "sshd" || true
@@ -116,7 +107,6 @@ case "$1" in
 	;;
 
   restart)
-	check_for_upstart 1
 	check_privsep_dir
 	check_config
 	log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true
@@ -131,7 +121,6 @@ case "$1" in
 	;;
 
   try-restart)
-	check_for_upstart 1
 	check_privsep_dir
 	check_config
 	log_daemon_msg "Restarting OpenBSD Secure Shell server" "sshd" || true
@@ -162,7 +151,6 @@ case "$1" in
 	;;
 
   status)
-	check_for_upstart 1
 	status_of_proc -p /run/sshd.pid /usr/sbin/sshd sshd && exit 0 || exit $?
 	;;
 
diff --git a/debian/openssh-server.ssh.upstart b/debian/openssh-server.ssh.upstart
deleted file mode 100644
index 9b0e954..0000000
--- a/debian/openssh-server.ssh.upstart
+++ /dev/null
@@ -1,29 +0,0 @@
-# ssh - OpenBSD Secure Shell server
-#
-# The OpenSSH server provides secure shell access to the system.
-
-description	"OpenSSH server"
-
-start on runlevel [2345]
-stop on runlevel [!2345]
-
-respawn
-respawn limit 10 5
-umask 022
-
-env SSH_SIGSTOP=1
-expect stop
-
-# 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
-console none
-
-pre-start script
-    test -x /usr/sbin/sshd || { stop; exit 0; }
-    test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
-
-    mkdir -p -m0755 /run/sshd
-end script
-
-# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
-# 'exec' line here instead
-exec /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 672d2a0..0000000
--- a/debian/ssh-agent.user-session.upstart
+++ /dev/null
@@ -1,7 +0,0 @@
-description "SSH Agent"
-author "Stéphane Graber <stgra...@ubuntu.com>"
-
-start on starting xsession-init
-
-exec /usr/lib/openssh/agent-launch start
-post-stop exec /usr/lib/openssh/agent-launch stop
-- 
2.7.4

>From 8be7273c2042684169def7f790cb8ac68a05bbab Mon Sep 17 00:00:00 2001
From: Dimitri John Ledkov <x...@ubuntu.com>
Date: Mon, 21 Aug 2017 13:03:05 +0100
Subject: [PATCH 2/2] Fix up drop sshd.conf

---
 debian/openssh-server.install | 1 -
 1 file changed, 1 deletion(-)

diff --git a/debian/openssh-server.install b/debian/openssh-server.install
index 7fdf609..a2d8fed 100755
--- a/debian/openssh-server.install
+++ b/debian/openssh-server.install
@@ -12,7 +12,6 @@ debian/openssh-server.if-up => etc/network/if-up.d/openssh-server
 debian/openssh-server.ufw.profile => etc/ufw/applications.d/openssh-server
 debian/systemd/ssh.socket lib/systemd/system
 debian/systemd/ssh@.service lib/systemd/system
-debian/systemd/sshd.conf usr/lib/tmpfiles.d
 debian/systemd/ssh-session-cleanup usr/lib/openssh
 
 # dh_apport would be neater, but at the time of writing it isn't in unstable
-- 
2.7.4

Reply via email to