Skip to content

Commit 1875759

Browse files
committed
Merge branch 'hg'
2 parents 30e917e + 1578fe8 commit 1875759

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

.hgtags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,5 @@ d3a4e98be3b2016eecfd2fc31437d9b386a9b0c0 st203
515515
611b9daec17e8217a55d6418976b2c407604f26d st204
516516
acf995441b3cfe6bea0fa77889d9d163feba4ab5 st205
517517
acf995441b3cfe6bea0fa77889d9d163feba4ab5 st206
518+
0b7ad5b7298ab0e67c46d168776275c35807247f st207
519+
0b7ad5b7298ab0e67c46d168776275c35807247f 11.4.87.0.1.207.0

src/pkg/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ UPDATENUM = 4
2828
# The SRUNUM will need to be reset once the final trunk build for
2929
# the delivery from trunk has been delivered.
3030
#
31-
SRUNUM = 87
31+
SRUNUM = 90
3232
ORDER = 0
3333
#
3434
# In the normal case the PLATNUM should be 0, however when

src/pkg/external_deps.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
# Only the variant used by pkg(7) utilities is listed here;
5555
# this is to avoid unnecessary circular dependencies with ON.
5656
pkg:/system/library/python/solaris-core-311
57+
pkg:/system/python/boot-environment-utilities-311
5758
pkg:/system/library/security/crypto
5859
pkg:/system/library/smf
5960
pkg:/system/linker

src/svc/svc-pkg-auto-update.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import pkg.no_site_packages
2727
import pkg.smf as smf
2828
import pkg.client.pkgdefs as pkgdefs
29+
import bemgmt
2930
import smf_include
3031
import os
3132
import subprocess
@@ -121,8 +122,7 @@ def start():
121122
pkg_status = subprocess.call(cmd)
122123
if pkg_status != pkgdefs.EXIT_LOCKED:
123124
break
124-
print('Image locked, sleeping for {0} seconds'.format(wait_secs),
125-
flush=True)
125+
print(f'Image locked, sleeping for {wait_secs} seconds', flush=True)
126126
time.sleep(wait_secs)
127127

128128
if pkg_status == pkgdefs.EXIT_NOP:
@@ -154,15 +154,24 @@ def start():
154154
new_be_activated = pkgplan['activate-be']
155155
if new_be_created and new_be_activated and auto_reboot:
156156
if check_before_reboot:
157-
print('Running reboot-check-hook {0}'.format(reboot_hook))
157+
print(f'Running reboot-check-hook {reboot_hook}')
158158
exitcode, output = subprocess.getstatusoutput(reboot_hook)
159159
if exitcode != 0:
160+
print(output)
161+
bename = pkgplan['be-name']
162+
print(f'Reboot Hook failed {exitcode}, removing {bename}')
163+
# Remove the BE as a future auto-update may create the same BE.
164+
# Leaving it risks it becoming stale and surprising the
165+
# admin on a manual reboot.
166+
try:
167+
bemgmt.BEManager().destroy(bename)
168+
except bemgmt.be_errors.BeMgmtError as e:
169+
print(f"BE destroy failed: {e}")
170+
pass
160171
message = f'Reboot Hook failed {exitcode}, see service log'
161172
smf_include.smf_method_exit(smf_include.SMF_EXIT_DEGRADED,
162173
'reboot-check-hook-failed',
163174
message)
164-
print('Reboot hook output follows:')
165-
print(output)
166175

167176
print('Reboot after auto update')
168177
msg = myfmri + ' : automatic reboot after update'

0 commit comments

Comments
 (0)