Don't listen to DeviceD power off signal 84/184384/4 accepted/tizen/unified/20180725.060434 submit/tizen/20180724.051636
authorMichal Bloch <m.bloch@samsung.com>
Tue, 17 Jul 2018 13:10:54 +0000 (15:10 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Tue, 24 Jul 2018 11:34:52 +0000 (13:34 +0200)
DeviceD currently sends the ChangeState signal on the PowerOff interface,
which causes resourced's main loop to quit, before the PrePowerOff method
is called (which then is not handled). With PrePowerOff uncalled, the VIP
cgroup is left mounted, which causes the platform to reboot on the death
of any VIP process. This makes it impossible to do a regular poweroff as
VIPs die throughout which replaces the poweroff with a reboot.

Removing the signal handler is safe as the signal is somewhat redundant.
Quitting the main loop happens eventually regardless since at some point
DeviceD sends SIGTERM (which also quits the main loop).

Change-Id: I552e4575ad97ae377a96daa0cba24bbe03c0d3bf
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/proc-stat/proc-monitor.c

index ed34303a66896e174bfbb83c07a1dfce89f6847d..e5c2094f6593e87f66074d938061d43be68414c0 100755 (executable)
@@ -792,12 +792,6 @@ static void low_battery_signal_handler(GVariant *params)
        resourced_notify(RESOURCED_NOTIFIER_LOW_BATTERY, NULL);
 }
 
-static void poweroff_signal_handler(GVariant *params)
-{
-       _E("quit mainloop at poweroff");
-       resourced_quit_mainloop();
-}
-
 static void systemtime_changed_signal_handler(GVariant *params)
 {
        resourced_notify(RESOURCED_NOTIFIER_SYSTEMTIME_CHANGED, NULL);
@@ -1087,8 +1081,10 @@ static const struct d_bus_signal dbus_signals[] = {
            SIGNAL_DEVICED_LCDOFF, proc_dbus_lcd_off, NULL},
        {DEVICED_PATH_CORE, DEVICED_INTERFACE_CORE,
            SIGNAL_DEVICED_BOOTINGDONE, booting_done_signal_handler, NULL},
-       {DEVICED_PATH_POWEROFF, DEVICED_INTERFACE_POWEROFF,
-           SIGNAL_DEVICED_POWEROFF_STATE, poweroff_signal_handler, NULL},
+       /* DEVICED_INTERFACE_POWEROFF / SIGNAL_DEVICED_CHANGESTATE left unhandled
+          on purpose - DeviceD sends the signal earlier than supposed to. Nothing
+          is lost though because at some point DeviceD also sends a SIGTERM,
+          which is handled the same way (i.e. quits the main loop). */
        {DEVICED_PATH_BATTERY, DEVICED_INTERFACE_BATTERY,
            SIGNAL_DEVICED_LOW_BATTERY, low_battery_signal_handler, NULL},
        {DUMP_SERVICE_OBJECT_PATH, DUMP_SERVICE_INTERFACE_NAME,