Bug 4213 - opkg: systemd service won't restart on upgrade
Summary: opkg: systemd service won't restart on upgrade
Status: RESOLVED FIXED
Alias: None
Product: Installation
Classification: Runtime
Component: Installation (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 1.4 M6
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-04-06 11:20 UTC by Yevhen
Modified: 2013-04-12 12:43 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yevhen 2013-04-06 11:20:50 UTC
When opkg is used as package manager and systemd is used as init system there is a problem with restarting systemd service on upgrading.
opkg doesn't call prerm script which should stop old service but calls postinst script that starts service. 
Therefore new service won't start since old one wasn't stopped.

Steps to reproduce:
1) Build a systemd based image with opkg package manager.
2) Start image.
3) Build any package that has systemd service (e.g. connman).
4) Copy two packages that was builded (e.g. "connman" and "connman-systemd") from deploy/ipk/<arch> directory into image.
5) Make "opkg install <path to copied packages>/connman*" on image
6) Remove these packages (they do not needed anymore)
7) Increase package revision of connman.
8) Do step 3 - 5.
9) Make "opkg install <path to copied packages>/connman*" on image

Expected behavior:
In journalctl you have to see a message about stopping and starting connman service.

Actual behavior:
In journalctl you have to see an *error* message about starting connman service (service wasn't stopped).
Comment 1 Ross Burton 2013-04-09 11:34:09 UTC
Clearly missing behaviour in opkg, but it's also documented missing behaviour in opkg.  I guess the postinst should restart, just in case we're running on opkg.
Comment 2 Ross Burton 2013-04-09 15:53:34 UTC
Filed #4232 for the opkg bug, and sent a patch to oe-core which changes postinst to "restart" the service instead of "start".
Comment 3 Ross Burton 2013-04-12 12:43:36 UTC
Fixed in oe-core 319ef0df4ae7ed0372eff90e11244123eccb023c.