60
60
# but it's simple enough to perform the check here and save
61
61
# Upstart the effort.
63
elif dpkg --compare-versions "$UPSTART_VERSION_RUNNING" ge 1.6.1; then
63
elif dpkg --compare-versions "$UPSTART_VERSION_RUNNING" ge 1.9 || [ "$UPSTART_VERSION_RUNNING" = 1.8-ubuntu-full-serialization ]; then
64
64
# We are not running inside a chroot and the running version
65
# of Upstart supports stateful re-exec, so we can
65
# of Upstart supports lossless stateful re-exec, so we can
66
66
# restart immediately.
68
68
# XXX: Note that the check on the running version must
71
71
# packaged version numbers is not sufficient since
72
72
# the package could be upgraded multiple times without a
74
runlevel=$(runlevel|awk '{print $2}' || :)
76
# Only perform stateful re-exec with upstart that has
77
# full serialisation or if running on a system that
78
# has booted "fully" to runlevel 2 or higher.
80
# This works around a potential problem where
81
# cloud-init (which runs in early boot) in
82
# dist-upgrading the system ends up upgrading Upstart,
83
# which calls this maintainer script.
85
if dpkg --compare-versions "$UPSTART_VERSION_RUNNING" ge 1.9 || [ "$UPSTART_VERSION_RUNNING" = 1.8-ubuntu-full-serialization ]
88
elif [ "$UPSTART_JOB" = "cloud-config" ]
90
touch /var/run/init.upgraded || :
91
[ -x /usr/share/update-notifier/notify-reboot-required ] && \
92
/usr/share/update-notifier/notify-reboot-required || true
99
touch /var/run/init.upgraded || :
100
[ -x /usr/share/update-notifier/notify-reboot-required ] && \
101
/usr/share/update-notifier/notify-reboot-required || true
75
elif [ "$UPSTART_JOB" = "cloud-config" ]; then
76
# If upgraded by cloud-init, do not perform partial
77
# stateful re-exec, as cloud-init instance will fail
79
touch /var/run/init.upgraded || :
80
[ -x /usr/share/update-notifier/notify-reboot-required ] && \
81
/usr/share/update-notifier/notify-reboot-required || true
83
elif dpkg --compare-version "$UPSTART_VERSION_RUNNING" ge 1.6.1; then
84
# Otherwise, perform partial stateful re-exec and
87
[ -x /usr/share/update-notifier/notify-reboot-required ] && \
88
/usr/share/update-notifier/notify-reboot-required || true
106
90
# Before we shutdown or reboot, we need to re-exec so that we
107
91
# can safely remount the root filesystem; we can't just do that