I have the following code executed in the
%post section of a kickstart file for RHEL 6.6.
echo '#!/bin/sh' > /root/add_user echo 'if [ $# -lt 1 ]; then echo "no username provided"; exit 1; fi' >> /root/add_user echo 'set -e' >> /root/add_user echo 'useradd $1 -g foo -G wheel,dialout,sshusers -m' >> /root/add_user echo 'passwd $1' >> /root/add_user chmod +x /root/add_user
The file is created correctly however is not chmoded with executable permissions. I have a log file as well for the post section and no error is reported in terms of the
chmod command or any other errors at all. I can not figure out why the file is unable to be set to have executable permissions, any idea why this may be happening?
When I do a verbose
chmod I get the following in the log
mode of /root/add_user retained as 0755