Starting postgresql in %post Redhat 8.0

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

 



Hi all,

I have a perplexing problem . I want to start postgresql In %post section of Kickstart, so I can connect to template1 as postgres user, add new DB users, and initialise a database (All in ks.cfg). I would also like to be able to initialise a DB from a schema once the user is created

I have done this in ks.cfg :

%post --interpreter /bin/bash
/sbin/service postgresql start
/bin/echo "CREATE USER admin WITH PASSWORD 'somepassword' CREATEDB CREATEUSER;"| /usr/bin/psql -d template1 -U postgres

However, the user is never created. I have done this:

/sbin/service postgresql start 2>&1 >/tmp/startPGresult

Just to see the result returned from the command. /tmp/startPGresult contains:

Initializing database: ESC[60G[  ESC[0;32mOKESC[0;39m  ]
Starting postgresql service: ESC[60G[ESC[0;31mFAILEDESC[0;39m]

So postmaster is never started therefore add user command will never work.

I have also tried:
/etc/rc.d/init.d/postgresql start 2>&1 >/tmp/startPGresult

With same result (Not that I expected different)......

I found one old post refering to starting postgresql in kickstart %post, and it says they were successfull. However, it involved use of 'chvt 3' before starting postgresql. I didn't think that VT's are available in latest install for Redhat ?? Therefore have not tried this.

Any assistance will be most appreciated.

Cheers,
Michael









[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