openvswitch post-upgrade script exited with error 1 on run-from-ram usb and OVS not launched while running in sys mode (hdd)
installing openvswitch (edge/testing) is now a breeze.
But, with run-from-ram (usb), at subsequent reboot after “rc-update add ovs-modules;rc-update add ovsdb-server;rc-update add ovs-vswitchd;lbu ci;reboot” was issued the post-upgrade script always complain that /etc/openvswitch/conf.db is in use and exit with return code 1.
apk fix let us see the same message in details
Reinstalling openvswitch (2.3.0-r4)
Executing openvswitch-2.3.0-r4.post-upgrade
Trying scema migration for /etc/openvswitch/conf.db...
2014-10-02T16:29:11Z|00001|lockfile|WARN|/etc/openvswitch/.conf.db.~lock~: cannot lock file because it is already locked by pid 1756
ovsdb-tool: /etc/openvswitch/conf.db: failed to lock lockfile (Resource temporarily unavailable)
ERROR: openvswitch-2.3.0-r4.post-upgrade: script exited with error 1
Executing busybox-1.22.1.r13.trigger
1 errors; 75 MiB in 90 packages
This is not a big deal as everything seems to work. But I guess that for a real upgrade this may cause problem…
On the other hand, while running from HDD (sys mode), even if “rc-update add ovs-modules;rc-update add ovsdb-server;rc-update add ovs-vswitchd” was previously issued, the OVS daemons do not start at boot time. One has to start those by hand…
(from redmine: issue id 3417, created on 2014-10-02, closed on 2015-12-09)
- Relations:
- relates #3498 (closed)
- Changesets:
- Revision 21dbf20f by Natanael Copa on 2014-10-06T16:12:21Z:
testing/openvswitch: fix creation/upgrade of database
Instead of create/update database from install script we do it from
init.d script. This is becase:
- we need /dev/urandom, which might not exist til until the mdev/udev
service is started. We cannot assume those are running during
install
- in case of upgrade, if the service is running (which is normally is)
we will get locking error because the db is in use.
We solve both those things by creating/upgrading the database before
starting it, from the init.d script.
fixes #3417