yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #38313
[Bug 1494040] [NEW] cloud-init-per semantics are broken by migrator-module renaming lockfiles
Public bug reported:
Steps to reproduce:
on a system containing a default cloud-init configuration
1. manually create a frequency 'once' lock using:
/usr/bin/cloud-init-per once testing-cloud-init-once echo hello
2. reboot.
3. login again and repeat the above cloud-init-per command.
Expected output: none
Actual output : "hello"
Trigger/Cause:
Lock file
/var/lib/cloud/sem/testing-cloud-init-once
has been renamed to
/var/lib/cloud/sem/testing_cloud_init_once
by the helper function at:
http://bazaar.launchpad.net/~harlowja/cloud-init/migrator-module/view/head:/cloudinit/helpers.py#L75
Suggested possible corrections:
1. Change the default for the migration module to be false. I have been unable to find any discussion supporting the current setting of 'true'.
2. Add a warning in the cloud-init-per script, something like:
``` diff
--- tools/cloud-init-per 2011-12-20 17:01:07 +0000
+++ tools/cloud-init-per 2015-09-09 21:04:34 +0000
@@ -40,6 +40,9 @@
name=$2
shift 2;
+[ "${name#*-}" = "${name}" ] || error "Warning: name contains a hyphen(-)," \
+ "lockfile may be renamed by migrator module;" \
+ "causing frequency constraints to be lost."
[ "${name#*/}" = "${name}" ] || fail "name cannot contain a /"
[ "$(id -u)" = "0" ] || fail "must be root"
```
** Affects: cloud-init
Importance: Undecided
Status: New
** Branch linked: lp:~harlowja/cloud-init/migrator-module
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1494040
Title:
cloud-init-per semantics are broken by migrator-module renaming
lockfiles
Status in cloud-init:
New
Bug description:
Steps to reproduce:
on a system containing a default cloud-init configuration
1. manually create a frequency 'once' lock using:
/usr/bin/cloud-init-per once testing-cloud-init-once echo hello
2. reboot.
3. login again and repeat the above cloud-init-per command.
Expected output: none
Actual output : "hello"
Trigger/Cause:
Lock file
/var/lib/cloud/sem/testing-cloud-init-once
has been renamed to
/var/lib/cloud/sem/testing_cloud_init_once
by the helper function at:
http://bazaar.launchpad.net/~harlowja/cloud-init/migrator-module/view/head:/cloudinit/helpers.py#L75
Suggested possible corrections:
1. Change the default for the migration module to be false. I have been unable to find any discussion supporting the current setting of 'true'.
2. Add a warning in the cloud-init-per script, something like:
``` diff
--- tools/cloud-init-per 2011-12-20 17:01:07 +0000
+++ tools/cloud-init-per 2015-09-09 21:04:34 +0000
@@ -40,6 +40,9 @@
name=$2
shift 2;
+[ "${name#*-}" = "${name}" ] || error "Warning: name contains a hyphen(-)," \
+ "lockfile may be renamed by migrator module;" \
+ "causing frequency constraints to be lost."
[ "${name#*/}" = "${name}" ] || fail "name cannot contain a /"
[ "$(id -u)" = "0" ] || fail "must be root"
```
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1494040/+subscriptions