diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2017-08-21 12:48:31 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-08-22 16:17:24 +0100 |
commit | b4fc0d329c03de1c38dc3f908a10f7239c32a05c (patch) | |
tree | 9187928083f825c0cdc32a2bfc0fd369a600ea38 | |
parent | 0aa09c9ec85924a27d864ccf26bc1fed79b41946 (diff) |
Drop upstart system and user jobs.
-rwxr-xr-x | debian/agent-launch | 8 | ||||
-rw-r--r-- | debian/changelog | 4 | ||||
-rwxr-xr-x | debian/openssh-client.install | 5 | ||||
-rw-r--r-- | debian/openssh-server.maintscript | 1 | ||||
-rw-r--r-- | debian/openssh-server.postinst | 7 | ||||
-rw-r--r-- | debian/openssh-server.ssh.init | 12 | ||||
-rw-r--r-- | debian/openssh-server.ssh.upstart | 29 | ||||
-rw-r--r-- | debian/ssh-agent.user-session.upstart | 7 |
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 |
3 | set -e | 3 | set -e |
4 | 4 | ||
5 | if [ ! -d "$XDG_RUNTIME_DIR" ]; then | 5 | if [ ! -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 |
19 | elif [ "$1" = stop ]; then | 16 | elif [ "$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 |
26 | else | 20 | else |
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 @@ | |||
1 | openssh (1:7.5p1-6) UNRELEASED; urgency=medium | 1 | openssh (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 | ||
10 | openssh (1:7.5p1-5) unstable; urgency=medium | 14 | openssh (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. |
33 | debian/openssh-client.apport => usr/share/apport/package-hooks/openssh-client.py | 33 | debian/openssh-client.apport => usr/share/apport/package-hooks/openssh-client.py |
34 | 34 | ||
35 | # Upstart user job (only used under user sessions). | ||
36 | debian/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) |
39 | debian/systemd/ssh-agent.service usr/lib/systemd/user | 36 | debian/systemd/ssh-agent.service usr/lib/systemd/user |
40 | # disable above upstart job when running the systemd user unit | ||
41 | debian/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 @@ | |||
1 | mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd 1:4.7p1-4~ | 1 | mv_conffile /etc/pam.d/ssh /etc/pam.d/sshd 1:4.7p1-4~ |
2 | 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 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 | ||
36 | check_for_upstart() { | ||
37 | if init_is_upstart; then | ||
38 | exit $1 | ||
39 | fi | ||
40 | } | ||
41 | |||
42 | check_for_no_start() { | 36 | check_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 | ||
83 | case "$1" in | 77 | case "$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 | |||
5 | description "OpenSSH server" | ||
6 | |||
7 | start on runlevel [2345] | ||
8 | stop on runlevel [!2345] | ||
9 | |||
10 | respawn | ||
11 | respawn limit 10 5 | ||
12 | umask 022 | ||
13 | |||
14 | env SSH_SIGSTOP=1 | ||
15 | expect stop | ||
16 | |||
17 | # 'sshd -D' leaks stderr and confuses things in conjunction with 'console log' | ||
18 | console none | ||
19 | |||
20 | pre-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 | ||
25 | end script | ||
26 | |||
27 | # if you used to set SSHD_OPTS in /etc/default/ssh, you can change the | ||
28 | # 'exec' line here instead | ||
29 | 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 672d2a0de..000000000 --- a/debian/ssh-agent.user-session.upstart +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | description "SSH Agent" | ||
2 | author "Stéphane Graber <stgraber@ubuntu.com>" | ||
3 | |||
4 | start on starting xsession-init | ||
5 | |||
6 | exec /usr/lib/openssh/agent-launch start | ||
7 | post-stop exec /usr/lib/openssh/agent-launch stop | ||