22 June 2014

Foreman Session Idle Time

After Foreman installation finished, whenever wanted to click on any links on the web based gui, it throw me out with "Your session has expired, please login again" message.

Solution is to change the idle timeout which is by default sets to 0 to another value like 30 or 60:

Administer > Settings > General 

set idle_timeout 0 -> 60

4 June 2014

Issue with Starting Postgresql server RHEL/CentOS 6

After I've installed postgresql on my Redhat enterprise Linux 6, it failed to start:

# service postgresql start
Starting postgresql service:                               [FAILED]

After I checked the postgresql logs, 

# vim /var/lib/pgsql/pgstartup.log

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

fixing permissions on existing directory /var/lib/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

Success. You can now start the database server using:

    /usr/bin/postgres -D /var/lib/pgsql/data
    /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start

LOG:  could not translate host name "localhost", service "5432" to address: Name or service not known
WARNING:  could not create listen socket for "localhost"
FATAL:  could not create any TCP/IP sockets

I noticed it seems something goes wrong with "localhost" name resolution that server cannot create listen socket for "localhost", 

Then I remembered, in my /etc/hosts I have commented out the localhost entry for some unknown reasons and "ping localhost" returns no result: 

# cat /etc/hosts
#       localhost.localdomain   localhost.localdomain   localhost4      localhost4.localdomain4 localhost       myhostname.example.com
::1     localhost.localdomain   localhost.localdomain   localhost6      localhost6.localdomain6 localhost     

Once I removed the comment for line, postgresql started successfully:

# service postgresql start
Starting postgresql service:                               [  OK  ]