Postgresql 9.6 server not getting started - ubuntu 12.04

2.5k views Asked by At

I have installed postgresql 9.6 in Ubuntu 12.04. Only Postgresql 9.6 version is there, I have removed old version totally.

However server is not getting started by

/etc/init.d/postgresql start

Command doesn't raise any errors but there is no process started for this. Then I have started server manually by the following command.

/usr/lib/postgresql/9.6/bin/postgres -d 3 -D /var/lib/postgresql/9.6/main/ -c config_file=/etc/postgresql/9.6/main/postgresql.conf

Here is the response of the command.

2017-01-04 12:13:09 IST [14117-1] DEBUG:  postgres: PostmasterMain: initial environment dump:
2017-01-04 12:13:09 IST [14117-2] DEBUG:  -----------------------------------------
2017-01-04 12:13:09 IST [14117-3] DEBUG:    TERM=xterm
2017-01-04 12:13:09 IST [14117-4] DEBUG:    SHELL=/bin/bash
2017-01-04 12:13:09 IST [14117-5] DEBUG:    XDG_SESSION_COOKIE=4fcea99dda8663a9f10a0af30000000a-1483511466.91321-1562010601
2017-01-04 12:13:09 IST [14117-6] DEBUG:    USER=postgres
2017-01-04 12:13:09 IST [14117-7] DEBUG:    LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
2017-01-04 12:13:09 IST [14117-8] DEBUG:    SUDO_USER=viraj
2017-01-04 12:13:09 IST [14117-9] DEBUG:    SUDO_UID=1000
2017-01-04 12:13:09 IST [14117-10] DEBUG:   USERNAME=root
2017-01-04 12:13:09 IST [14117-11] DEBUG:   PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
2017-01-04 12:13:09 IST [14117-12] DEBUG:   MAIL=/var/mail/postgres
2017-01-04 12:13:09 IST [14117-13] DEBUG:   PWD=/root
2017-01-04 12:13:09 IST [14117-14] DEBUG:   LANG=en_IN
2017-01-04 12:13:09 IST [14117-15] DEBUG:   HOME=/var/lib/postgresql
2017-01-04 12:13:09 IST [14117-16] DEBUG:   SUDO_COMMAND=/bin/su
2017-01-04 12:13:09 IST [14117-17] DEBUG:   SHLVL=2
2017-01-04 12:13:09 IST [14117-18] DEBUG:   LANGUAGE=en_IN:en
2017-01-04 12:13:09 IST [14117-19] DEBUG:   LOGNAME=postgres
2017-01-04 12:13:09 IST [14117-20] DEBUG:   LESSOPEN=| /usr/bin/lesspipe %s
2017-01-04 12:13:09 IST [14117-21] DEBUG:   DISPLAY=:0
2017-01-04 12:13:09 IST [14117-22] DEBUG:   SUDO_GID=1000
2017-01-04 12:13:09 IST [14117-23] DEBUG:   LESSCLOSE=/usr/bin/lesspipe %s %s
2017-01-04 12:13:09 IST [14117-24] DEBUG:   COLORTERM=gnome-terminal
2017-01-04 12:13:09 IST [14117-25] DEBUG:   XAUTHORITY=/home/viraj/.Xauthority
2017-01-04 12:13:09 IST [14117-26] DEBUG:   _=/usr/lib/postgresql/9.6/bin/postgres
2017-01-04 12:13:09 IST [14117-27] DEBUG:   PGLOCALEDIR=/usr/share/locale
2017-01-04 12:13:09 IST [14117-28] DEBUG:   PGSYSCONFDIR=/etc/postgresql-common
2017-01-04 12:13:09 IST [14117-29] DEBUG:   LC_COLLATE=en_IN
2017-01-04 12:13:09 IST [14117-30] DEBUG:   LC_CTYPE=en_IN
2017-01-04 12:13:09 IST [14117-31] DEBUG:   LC_MESSAGES=en_IN
2017-01-04 12:13:09 IST [14117-32] DEBUG:   LC_MONETARY=C
2017-01-04 12:13:09 IST [14117-33] DEBUG:   LC_NUMERIC=C
2017-01-04 12:13:09 IST [14117-34] DEBUG:   LC_TIME=C
2017-01-04 12:13:09 IST [14117-35] DEBUG:  -----------------------------------------

2017-01-04 12:13:10 IST [14122-2] DEBUG:  InitPostgres
2017-01-04 12:13:10 IST [14122-3] DEBUG:  StartTransaction
2017-01-04 12:13:10 IST [14122-4] DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2017-01-04 12:13:10 IST [14122-5] DEBUG:  CommitTransaction
2017-01-04 12:13:10 IST [14122-6] DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
2017-01-04 12:13:10 IST [14123-1] DEBUG:  received inquiry for database 0
2017-01-04 12:13:10 IST [14123-2] DEBUG:  writing stats file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.stat"
2017-01-04 12:13:10 IST [14123-3] LOG:  could not open temporary statistics file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.tmp": No such file or directory
2017-01-04 12:13:10 IST [14123-4] DEBUG:  writing stats file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.stat"
2017-01-04 12:13:10 IST [14123-5] LOG:  could not open temporary statistics file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.tmp": No such file or directory
2017-01-04 12:13:10 IST [14123-6] DEBUG:  writing stats file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.stat"
2017-01-04 12:13:10 IST [14123-7] LOG:  could not open temporary statistics file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.tmp": No such file or directory
2017-01-04 12:13:10 IST [14123-8] DEBUG:  writing stats file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.stat"
2017-01-04 12:13:10 IST [14123-9] LOG:  could not open temporary statistics file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.tmp": No such file or directory
2017-01-04 12:13:10 IST [14123-10] DEBUG:  received inquiry for database 0
2017-01-04 12:13:10 IST [14123-11] DEBUG:  writing stats file "/var/run/postgresql/9.6-main.pg_stat_tmp/global.stat"

How could I fix this issue ?

While I try to connect to the postgresql following error message I got from system.

postgres@Viraj:/var/run$ psql -l
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
1

There are 1 answers

0
Emipro Technologies Pvt. Ltd. On BEST ANSWER

However it's only temporary solution, I didn't found perfect solution for this issue.

I have just created this directory and everything working fine.

New directory under /var/run/postgresql/

9.6-main.pg_stat_tmp.

Then server is working fine, start / stop properly.

NOTE: While you restart PC/Server then again the directory will not be there and the same error you will face. Every time you start/boot the PC needs to create Directory.