LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Post Installation script Failed to execute due to \r ? (https://www.linuxquestions.org/questions/centos-111/post-installation-script-failed-to-execute-due-to-%5Cr-4175595451/)

Jayzzzz 12-14-2016 11:12 PM

Post Installation script Failed to execute due to \r ?
 
1 Attachment(s)
Hi Guys
I was in a process of building my own centos vagrant box --provider VMware, during the post installation script, I have commands to add user vagrant and etc, however they all failed due to below error. something to do with \r is parsed literally to be executed
Attachment 23773

Code:

install
cdrom
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw  --plaintext vagrant
firewall --enabled --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc Australia/Sydney
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"

text
skipx
zerombr

clearpart --all --initlabel
autopart

auth  --useshadow  --enablemd5
firstboot --disabled
reboot

%packages --nobase --ignoremissing

@core
bzip2
kernel-devel
kernel-headers
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
%end


%post --log=/root/post.log

# Install SUDO
/usr/bin/yum -y install sudo

# Create vagrant user
/usr/sbin/useradd vagrant
/bin/mkdir /home/vagrant/.ssh
/bin/chmod 700 /home/vagrant/.ssh
/bin/echo "ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxx vagrant" > /home/vagrant/.ssh/authorized_keys

/bin/chmod 600 /home/vagrant/.ssh/authorized_keys
/bin/chown -R vagrant /home/vagrant/.ssh

# Add vagrant user to SUDO
/bin/echo "vagrant        ALL=(ALL)      NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
/bin/echo "Defaults:vagrant !requiretty"                >> /etc/sudoers.d/vagrant
/bin/chmod 0440 /etc/sudoers.d/vagrant
%end


Jayzzzz 12-14-2016 11:12 PM

Any help is appreciated

szboardstretcher 12-14-2016 11:15 PM

Dont post the same question in more than one forum. Bad etiquette. A solution is back at your original post: http://www.linuxquestions.org/questi...83#post5642283

michaelk 12-15-2016 05:44 AM

Closed per above


All times are GMT -5. The time now is 06:03 AM.