From 08bab444a31cafe88529d6e80e6d36ba4fb6774f Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Fri, 23 Nov 2012 17:24:45 +0800 Subject: [PATCH] Give alarm-server a low oom_adj value to avoid killed Currently, a positive oom_adj make alarm-server likely to be killed by system-server, which will pick up the one with positive oom_adj and increase it's oom_adj whenever it go to inactive or backgrd. Once its oom_adj larger or equal 15, it got killed by system-server. For sysvinit, there is a kernel module named pmon and user space tool which set important services as vip or permenant processes. So they're lesser to be killed and will be relaunched once it got killed. In systemd environment, it's easy to implement this feature by leverage the systemd feature. Change-Id: Ib89cdd1c94cfac66e1da88144db98ec1314b8865 Signed-off-by: Chengwei Yang --- packaging/alarm-server.service | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/alarm-server.service b/packaging/alarm-server.service index fd79712..70d4f4c 100644 --- a/packaging/alarm-server.service +++ b/packaging/alarm-server.service @@ -4,7 +4,9 @@ Description=Start the Alarm service [Service] ExecStart=/usr/bin/alarm-server Nice=5 -OOMScoreAdjust=100 +OOMScoreAdjust=-100 +Restart=always +RestartSec=2 [Install] WantedBy=multi-user.target -- 2.7.4