[Bug 1733353] Re: [SRU] Please accept hibagent to Xenial and Trusty
Dimitri John Ledkov
launchpad at surgut.co.uk
Tue Nov 21 08:17:25 UTC 2017
Launched a trusty instance on ec2, installed linux-aws kernel, rebooted, enabled proposed and installed hibagent (1.0.1-0ubuntu1~14.04.1). The installation was successful and installed a couple of extra new packages from main.
There are no preinst/postinst scripts thus it is inert by default, e.g. there was no hibagent running.
Executing enable-ec2-spot-hibernation as non-root user, did not ask to
elevate permissions via sudo, reported errors "update-rc.d: symlink:
Permission denied", and claimed that "Starting hibagent... Ok" and
exited normally with error code 0. There are no logs from non-root
invocation, logged anywhere, as the initd scripts redirects them to
/dev/null.
Looking at enable-ec2-spot-hibernation it uses /bin/bash, instead of
default ubuntu shell /bin/sh which should be dash. It appears that the
script does not use set -e.
Executing init.d script with set -x, and then executing hibagent as non
root prints a traceback, yet the invocation exits zero and no daemon is
running:
Traceback (most recent call last):
File "/usr/bin/hibagent", line 592, in <module>
main()
File "/usr/bin/hibagent", line 577, in main
daemonize(args.pidfile)
File "/usr/bin/hibagent", line 361, in daemonize
with open(pidfile, "w+") as fl:
PermissionError: [Errno 13] Permission denied: '/var/run/hibagent.pid'
When daemon fails to daemonize due to lack of permissions, it should not
return zero exit status code, as initd script misleadingly reports "Ok"
instead of "Failed to start".
Invoking $ sudo enable-ec2-spot-hibernation, has better results. rc.d
symlinks get actually installed and service hibagent status actually
reports the daemon as running, with pidfile matching the script invoked.
It would have been nicer to use /run/hibagent.pid, instead of the legacy
/var/run prefix.
Normal daemon operation appears to log into syslog.
Both init.d script and enable-ec2-spot-hibernation commands should check
for root permissions, and bail out asking to use sudo.
** Tags removed: verification-needed verification-needed-trusty
** Tags added: verification-done verification-done-trusty
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to hibagent in Ubuntu.
https://bugs.launchpad.net/bugs/1733353
Title:
[SRU] Please accept hibagent to Xenial and Trusty
Status in hibagent package in Ubuntu:
Fix Released
Status in hibagent source package in Trusty:
Fix Released
Status in hibagent source package in Xenial:
Fix Released
Bug description:
[Impact]
The package is new to the releases and adds EC2 instances ability to
hibernate on an external trigger.
[Test Case]
Please perform piuparts-like tests with the package and make sure that
hibagent service is not started upon the first install or upgrade.
Only running the shipped enable-ec2-spot-hibernation command should
enable the service and it should be kept enabled during package
updates.
The package needs kernel support and on generic systems the service
tries to start but fail with error.
[Regression Potential]
Since the package is new it may not cause regressions by being broken
but it should not be enabled by default. Accidentally having it
enabled would be considered a regression because it would allow
triggering hibernation on a system remotely.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/hibagent/+bug/1733353/+subscriptions
More information about the foundations-bugs
mailing list