LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Closed Thread
  Search this Thread
Old 12-15-2016, 12:12 AM   #1
Jayzzzz
LQ Newbie
 
Registered: Dec 2016
Posts: 5

Rep: Reputation: Disabled
Post Installation script Failed to execute due to \r ?


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
Click image for larger version

Name:	post.log.1.JPG
Views:	8
Size:	79.2 KB
ID:	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
 
Old 12-15-2016, 12:12 AM   #2
Jayzzzz
LQ Newbie
 
Registered: Dec 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Any help is appreciated
 
Old 12-15-2016, 12:15 AM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,213

Rep: Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614
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
 
1 members found this post helpful.
Old 12-15-2016, 06:44 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 18,066

Rep: Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499
Closed per above
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Failed miserably to execute bash script via PATH variable after FS migration. kopatops Linux - Software 21 08-18-2010 07:34 AM
[SOLVED] [Ubuntu] apt libxml-sax-perl "unable to execute installed post-installation script" XXLRay Linux - Software 1 07-17-2010 10:20 AM
crontab is failed to execute my python script tcyeo Linux - Newbie 4 04-06-2009 12:14 AM
I can execute shell script from CLI but failed to do via cron UltraSoul Linux - Software 2 06-24-2008 11:10 PM
Failed to execute cgi script in Apache!! baby_linu Linux - Newbie 4 06-30-2004 05:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 07:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration