killall returns false if nothing to kill
This commit is contained in:
parent
dc8716b25e
commit
2823a8d9b9
@ -56,7 +56,7 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
|
||||
UnixUser user = (UnixUser) entity;
|
||||
String uid = user.getName();
|
||||
if (uid != null && uid.length() > 4) {
|
||||
Processor killProcessesProc = new ShellProcessor("killall -u " + uid);
|
||||
Processor killProcessesProc = new ShellProcessor("killall -u " + uid + " || echo -n 'no processes'");
|
||||
Processor userdelProc = null;
|
||||
if (user.isDefaultHomedir()) {
|
||||
userdelProc = new ShellProcessor("userdel " + uid + " && rm -rf '" + user.getHomedir() + "'");
|
||||
|
Loading…
Reference in New Issue
Block a user