Adding postgres user in %post

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

I am trying to add a postgres user in the %post section of my kickstart
file for RedHat 7.0.  In my %post section I set postgresql to start and
stop in the 3rd run level then I try to add a postgres user called adam.
When I do a kickstart, no postgres user gets added.  If I set that one line
up in a script and run the script from a prompt a postgres user does get
added.  Do I need to reboot between starting/stopping postgresql and adding
the user?  I believe postgresql creates the user called postgres which I am
trying to use in my last command.  How come my reboot command doesn't seem
to do anything?

Any thoughts on how to get this to work would be greatly appreciated!!
Thanks!
Rebecca


%post

#start and stop postgresql in the 3rd run level
/sbin/chkconfig --level 3 postgresql off
/sbin/chkconfig --level 3 postgresql on

#reboot

#add postgres user called Adam, at this time only user postgres can add
other users
su - postgres -c "createuser adam -d -a"






[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux