Ich habe festgestellt, dass bei Verwendung der userOption execnicht die Umgebung des angegebenen Benutzers verwendet wird.
$ sudo -i puppet apply -e "exec { '/usr/bin/env': logoutput => true, user => nobody}"
notice: /Stage[main]//Exec[/usr/bin/env]/returns: SHELL=/bin/bash
notice: /Stage[main]//Exec[/usr/bin/env]/returns: USER=root
notice: /Stage[main]//Exec[/usr/bin/env]/returns: USERNAME=root
notice: /Stage[main]//Exec[/usr/bin/env]/returns: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
notice: /Stage[main]//Exec[/usr/bin/env]/returns: MAIL=/var/mail/root
notice: /Stage[main]//Exec[/usr/bin/env]/returns: PWD=/root
notice: /Stage[main]//Exec[/usr/bin/env]/returns: HOME=/root
notice: /Stage[main]//Exec[/usr/bin/env]/returns: LOGNAME=root
notice: /Stage[main]//Exec[/usr/bin/env]/returns: executed successfully
Während der Befehl wie folgt ausgeführt nobodywird USER, HOMEsind usw. nicht wie erwartet festgelegt. Gibt es eine Möglichkeit exec, eine Anmeldeshell zu simulieren, damit die Umgebung wie erwartet eingerichtet wird?