Forum: Cfengine Help
Subject: Re: Process termination
Author: Seva Gluschenko
Link to topic: https://cfengine.com/forum/read.php?3,20526,20527#msg-20527
Eduard,
you should have read body process select description more thoroughly. Your
process selector matches any processes owned by the user selected, 'cause
process_result => "process_owner"; just means it. You should change it to the
class match: process_result => "process_owner.stime.command";
Perhaps, you might want to write more generic body, e.g.:
body process_select old_user(user)
{
process_owner => { "$(user)" };
stime_range => irange(ago(1,0,0,0,0,0),ago(0,0,0,5,0,0));
process_result => "process_owner.stime";
}
Then you can call it with different user names:
processes:
"sshd.*"
process_select => old_command_by_user("ruser"),
signals => { "term", "kill" },
comment => "Killing ruser old processes";
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine