User Deletion: killall should not return exit code != 0.
This commit is contained in:
parent
0ab359e690
commit
1f2eb8a099
@ -162,7 +162,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Processor createDelUserProc(String pacName) {
|
private Processor createDelUserProc(String pacName) {
|
||||||
Processor killProcessesProc = new ShellProcessor("killall -TERM -u " + pacName + " && sleep 5 && killall -KILL -u " + pacName + " && sleep 5");
|
Processor killProcessesProc = new ShellProcessor("killall -TERM -u " + pacName + " && sleep 5 && killall -KILL -u " + pacName + " && sleep 5 || true");
|
||||||
Processor userdelProc = new ShellProcessor("deluser --remove-all-files " + pacName);
|
Processor userdelProc = new ShellProcessor("deluser --remove-all-files " + pacName);
|
||||||
CompoundProcessor proc = new CompoundProcessor(killProcessesProc, userdelProc);
|
CompoundProcessor proc = new CompoundProcessor(killProcessesProc, userdelProc);
|
||||||
proc.appendProcessor(new ShellProcessor("rm -f '/var/spool/cron/crontabs/" + pacName + "'"));
|
proc.appendProcessor(new ShellProcessor("rm -f '/var/spool/cron/crontabs/" + pacName + "'"));
|
||||||
|
@ -56,7 +56,7 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
|
|||||||
UnixUser user = (UnixUser) entity;
|
UnixUser user = (UnixUser) entity;
|
||||||
String uid = user.getName();
|
String uid = user.getName();
|
||||||
if (uid != null && uid.length() > 4) {
|
if (uid != null && uid.length() > 4) {
|
||||||
Processor killProcessesProc = new ShellProcessor("killall -TERM -u " + uid + " && sleep 5 && killall -KILL -u " + uid + " && sleep 5");
|
Processor killProcessesProc = new ShellProcessor("killall -TERM -u " + uid + " && sleep 5 && killall -KILL -u " + uid + " && sleep 5 || true");
|
||||||
Processor userdelProc = null;
|
Processor userdelProc = null;
|
||||||
if (user.isDefaultHomedir()) {
|
if (user.isDefaultHomedir()) {
|
||||||
userdelProc = new ShellProcessor("deluser --remove-all-files " + uid);
|
userdelProc = new ShellProcessor("deluser --remove-all-files " + uid);
|
||||||
|
Loading…
Reference in New Issue
Block a user