Automatically restart wrt_launchpad_daemon after install package
authorJihoon Chung <jihoon.chung@samsaung.com>
Thu, 3 Oct 2013 02:42:40 +0000 (11:42 +0900)
committerHoseon LEE <hoseon46.lee@samsung.com>
Mon, 14 Oct 2013 11:34:21 +0000 (20:34 +0900)
commitce9115f30e858991cbf85f2440966dc8d3297eda
treed7b80a94137cf614568b8a323dec86de6f126957
parentbb0cc5ac97db8499c5f40d706b8dc05c530c57b0
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
packaging/wrt.spec