Revert "No more unmount cgroup directory before power off" 53/122753/3
authorKunhoon Baik <knhoon.baik@samsung.com>
Mon, 3 Apr 2017 09:03:45 +0000 (02:03 -0700)
committerKunhoon Baik <knhoon.baik@samsung.com>
Mon, 3 Apr 2017 09:05:56 +0000 (02:05 -0700)
This reverts commit e76a114e90e33a78408f5c04ad2eb35aca5b90d1.

This commit should be reconsidered
because systemd unit file cannot distinguish
between power-off SIGTERM and normal SIGTERM.

For example, deviced sends SIGTERM
when a process do not close fd using a file in SD-CARD
during the SD-card is removed / unmounted.
Deviced also sends SIGTERM during a power-off for unmounting /opt/usr.

Thus, a process cannot distiguish the situation with systemd unit.

As a result,
another solution for stopping service-restart during power-off
should be considered. (like modifying systemd or faultd)

Until the time, resourced's original solution should be kept.

cf) Solving the power-off animation problem,
    deviced should wait to start "power-off animation service".

Change-Id: I5f271a427109cdf26847411f8dc1cea91742d2f9

src/proc-stat/proc-monitor.c
src/vip-agent/vip-release-agent.c

index 005818e..71d2acd 100755 (executable)
@@ -158,6 +158,7 @@ static DBusMessage *edbus_pre_poweroff(E_DBus_Object *obj, DBusMessage *msg)
 
        proc_sweep_memory(PROC_SWEEP_EXCLUDE_ACTIVE, INIT_PID);
        resourced_notify(RESOURCED_NOTIFIER_POWER_OFF, NULL);
+       umount2("/sys/fs/cgroup", MNT_FORCE|MNT_DETACH);
 
        reply = dbus_message_new_method_return(msg);
        dbus_message_iter_init_append(reply, &iter);
index a76c11e..50b642b 100644 (file)
@@ -90,6 +90,10 @@ int main(int argc, char *argv[])
                checkfd = 0;
        }
 
+       /* unmount cgroup for preventing launching another release-agent */
+       _E("systemd service stop");
+       umount2("/sys/fs/cgroup", MNT_FORCE |MNT_DETACH);
+
        /* check debug level */
        if (check_debugenable())
                run_exec(dumpargv);