LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-14-2016, 11:12 PM   #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:	16
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-14-2016, 11:12 PM   #2
Jayzzzz
LQ Newbie
 
Registered: Dec 2016
Posts: 5

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

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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, 05:44 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,722

Rep: Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916Reputation: 5916
Closed per above
 
  


Closed Thread



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 06:34 AM
[SOLVED] [Ubuntu] apt libxml-sax-perl "unable to execute installed post-installation script" XXLRay Linux - Software 1 07-17-2010 09:20 AM
crontab is failed to execute my python script tcyeo Linux - Newbie 4 04-05-2009 11:14 PM
I can execute shell script from CLI but failed to do via cron UltraSoul Linux - Software 2 06-24-2008 10:10 PM
Failed to execute cgi script in Apache!! baby_linu Linux - Newbie 4 06-30-2004 04:23 PM

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

All times are GMT -5. The time now is 12:14 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
Open Source Consulting | Domain Registration