Automatically restart wrt_launchpad_daemon after install package
* wrt_launchpad_daemon maintains three services:
1. wrt_launchpad_daemon@app.service
2. wrt_launchpad_daemon_1.socket
3. wrt_launchpad_daemon_2.socket
[Issue#] N/A
[Problem] Fail to restart wrt_launchpad_daemon after install a new package,
even though "wrt.spec" has restart command.
- systemctl restart wrt_launchpad_daemon@app.service
[Cause] Below preconditions are missed before restarting services.
- "stop service" with dependency service
(wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket)
- "daemon-reload" after installing a new service config file
- "if" condition used wrong value.
%post
install ($1 == 1)
upgrade ($1 == 2)
uninstall (N/A) --> Only available %postun
[Solution] Fixed missed preconditions
- "stop service" with dependency service
(wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket)
: Add command to stop all services during running "%pre".
Moreover, restart should do when wrt_launchpad_daemon is existed case.
To verify condition, add condition to check "upgrade package" case.
This change also applies to "%preun"
- "daemon-reload" after install new service config file
: The command for "daemon-reload" is existed in the "post". Keep current state.
However next command is "restart service".
As all services are stopped during running "%pre",
it changes to "start" service only for daemon.(wrt_launchpad_daemon@app.service)
Also add condition to run only "upgrade package" case.
[SCMRequest] Tizen RSA only
[Remarks] rpm reference http://fedoraproject.org/wiki/Packaging:ScriptletSnippets
Change-Id: I1559e6e94772e308e75cd41823998f5bec847892
Conflicts:
packaging/wrt.spec