Give alarm-server a low oom_adj value to avoid killed
authorChengwei Yang <chengwei.yang@intel.com>
Fri, 23 Nov 2012 09:24:45 +0000 (17:24 +0800)
committerChengwei Yang <chengwei.yang@intel.com>
Fri, 23 Nov 2012 09:24:45 +0000 (17:24 +0800)
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 <chengwei.yang@intel.com>
packaging/alarm-server.service

index fd79712..70d4f4c 100644 (file)
@@ -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