process: Fix watchdog handler to use proper appid 55/302755/3
authorSangYoun Kwak <sy.kwak@samsung.com>
Fri, 17 Nov 2023 02:23:57 +0000 (11:23 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Thu, 28 Dec 2023 09:30:01 +0000 (18:30 +0900)
commit2e9c7782c99da6bb02501e45ff201645a3dd854e
treef66e5ba3eb7342eb97cb8b8eac1b5dc61507daa7
parenta5c10457d3e34f4358a476d166c13b781a2a741c
process: Fix watchdog handler to use proper appid

The watchdog handler handles dbus signal(with a pid as a parameter) and
kills an app of this pid if its watchdog action is not configured as
"ignore".  (Watchdog action can be configured by locating proper .conf
file in /etc/resourced/process.conf.d.)

Previously, the watchdog handler uses /proc/<pid>/cmdline as an app
name, which is not an actual app name. This caused the watchdog handler
to think 'this app is not configured as "ignore"' even it is configured
as "ignore" because the actual app name and /proc/<pid>/cmdline are not
matched.
Thus, apps which should be not killed by the watchdog were killed.

To fix this issue, find_app_info() is used, which gets
struct proc_app_info from pid, to get the proper app name.

Change-Id: I2bc9c9d7ffcb45bbc10243241d4786fb73d2f7b4
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
src/process/proc-monitor.c