Unmask SIGTERM and enable PIDFile for systemd 02/27102/1 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_3.0_ivi accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen_3.0.2014.q3_common tizen_3.0.m14.3_ivi tizen_3.0_ivi accepted/tizen/common/20140918.164438 accepted/tizen/ivi/20140926.185848 submit/tizen/20140918.134732 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.3_ivi_release tizen_3.0_ivi_release
authorMikko Ylinen <mikko.ylinen@intel.com>
Thu, 4 Sep 2014 13:42:31 +0000 (16:42 +0300)
committerMikko Ylinen <mikko.ylinen@intel.com>
Thu, 4 Sep 2014 13:42:31 +0000 (16:42 +0300)
commit31269af4f5bdfd92a50ac39f14196bf333bea406
treea6130cd89501d0200d2b17242409c415ae543bb4
parent5635bde5ac3a9528eb253254fb090f93b6ecd000
Unmask SIGTERM and enable PIDFile for systemd

systemd service stop logic uses SIGTERM to stop services. However,
system_server daemon ignores that signal:

   systemd[1]: Stopping Start the system server service...
   system_server[3392]: main.c: sig_quit(47) > received SIGTERM signal 15

Due to TimeoutStopSec=2 being set, systemd waits 2 seconds until it
proceeds with kill:

   systemd[1]: system-server.service stopping timed out. Killing.
   systemd[1]: system-server.service: main process exited, code=killed,
               status=9/KILL

This delays system shutdown time.

Additionally, add PIDFile to tell systemd the .pid system_server uses.
This is useful since system-service.service uses 'forking' and is run
via device-daemon script.

Bug-Tizen: TC-1502

Change-Id: I5b00cf11a67ab15b651d754d270b0549c3f806f4
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
src/core/main.c
systemd/system-server.service