Bug 4213

Summary: opkg: systemd service won't restart on upgrade
Product: [Runtime] Installation Reporter: Yevhen <kirgene>
Component: InstallationAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: kevin.tian, meta.mr.watcher, meta.watcher, sgw
Version: unspecified   
Target Milestone: 1.4 M6   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

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.