From c995d08ce2305ec75bed9362d4a0ed845c7fcc92 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Thu, 11 Oct 2018 16:01:50 +0200 Subject: [PATCH] redirect stdout+stderr of `userdel` If no mail-spoolfile exists for the user the error reporting was visible in the cdist-run. --- cdist/conf/type/__user/gencode-remote | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__user/gencode-remote b/cdist/conf/type/__user/gencode-remote index a5b60ac6..8f2a422a 100755 --- a/cdist/conf/type/__user/gencode-remote +++ b/cdist/conf/type/__user/gencode-remote @@ -135,10 +135,10 @@ elif [ "$state" = "absent" ]; then if grep -q "^${name}:" "$__object/explorer/passwd"; then #user exists, but state != present, so delete it if [ -f "$__object/parameter/remove-home" ]; then - echo userdel -r "${name}" + printf "userdel -r %s >/dev/null 2>&1\n" "${name}" echo "userdel -r" >> "$__messages_out" else - echo userdel "${name}" + printf "userdel %s >/dev/null 2>&1\n" "${name}" echo "userdel" >> "$__messages_out" fi fi