killer (0.90-8) ignore-system-uids

Summary

 killer |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run

Make sure to not kill processes for system users (uid < 1000).

@DPATCH@
--- killer-0.90.orig/killer
+++ killer-0.90/killer
@@ -1085,6 +1086,14 @@
 
 my @validusers = ( 'condor', 'root', 'daemon' );
 
+=item $minuid
+
+Do not kill processes of users with uid lower than this value.
+
+=cut
+
+my $minuid = 1000;
+
 =item $maxidletime
 
 The maximum number of seconds that a user can be idle without being
@@ -1123,6 +1132,7 @@
 my @ttys;
 my @users;
 my $user;
+my $uid;
 
 =head2 gatherInfo
 
@@ -1205,6 +1215,16 @@
 
 =item *
 
+Removes all processes of users with uid lower than the $minuid value.
+
+=cut
+
+    foreach $uid ( 0 .. $minuid-1 ) {
+	$ptable->removeProcesses('uid', $uid);
+    }
+
+=item *
+
 Finally, the process table and terminal objects are returned.
 
 =back