PDA

View Full Version : postgresql-9.1 errors after installing a package



clearday
2013-04-13, 03:08
I keep getting postgresql-9.1 errors towards the end of just about any installation. Is this something to be concerned about? Please see below:

Setting up postgresql-9.1 (9.1.9-1) ...
[....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2013-04-13 03:02:51 UTC LOG: could not create IPv6 socket: Permission denied 2013-04-13 03:02:51 UTC LOG: could not create IPv4 socket: Permission denied 2013-04-13 03:02:51 UTC WARNING: could not create listen socket for "localhost" 2013-04-13 03:02:51 UTC FATAL: could no[FAILate any TCP/IP sockets ... failed!
failed!
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-9.1 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up less (444-4) ...
Setting up bundler (1.1.4-6) ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.10.4-1+wheezy1) ...
Setting up git (1:1.7.10.4-1+wheezy1) ...
Setting up rubygems-integration (1.1) ...
Setting up metasploit-framework (4.6.0-1-1kali1) ...
Errors were encountered while processing:
postgresql-9.1
E: Sub-process /usr/bin/dpkg returned an error code (1)


---
Setting up apache2 (2.2.22-13) ...
Setting up libdpkg-perl (1.16.10) ...
Setting up dpkg-dev (1.16.10) ...
Setting up kali-menu (1.333) ...
Processing triggers for menu ...
Processing triggers for python-support ...
Errors were encountered while processing:
postgresql-9.1
E: Sub-process /usr/bin/dpkg returned an error code (1)

charonsecurity
2013-04-13, 10:42
The PostgreSQL server failed to start. Please check the log output: 2013-04-13 03:02:51 UTC LOG: could not create IPv6 socket: Permission denied 2013-04-13 03:02:51

Can you post the output of the log, should be in /var/log/ directory

clearday
2013-04-13, 13:03
Can you post the output of the log, should be in /var/log/ directory

Not sure which log you needed (couldn't find a UTC log). Attached are the syslog, postgre, messages log files.

charonsecurity
2013-04-13, 17:30
hmm, it may be you are already using the port with another program, (Nexpose?). Try stopping the service and starting it manually.

service postgresql stop
service postgresql start, let us know what that does.

If that doesn't work, can you please tell us more about your setup, Which Kali version, type of install etc. Thanxs!

clearday
2013-04-14, 16:31
hmm, it may be you are already using the port with another program, (Nexpose?). Try stopping the service and starting it manually.

service postgresql stop
service postgresql start, let us know what that does.

If that doesn't work, can you please tell us more about your setup, Which Kali version, type of install etc. Thanxs!

Unfortunately, it didn't work. I have Kali 1.0, using Galaxy Note 10.1 image* installed in a Galaxy Note 2. Other than the annoying PostGreSql (used by Metasploit Framework) error, everything else seems to work fine. The error only presents itself when invoking the apt-get command (apt-get upgrade, apt-get install, apt-get autoremove).

* http://docs.kali.org/armel-armhf/kali-linux-on-galaxy-note

I launch Kali via Linux Deploy. Then I either use SSH for command line or VNC to use the GUI.

charonsecurity
2013-04-15, 03:00
I apologize, I'm am not sure where the error is coming from at this point. Not to familiar with how Kali is working on devices like the Note 2 (Though I must admit, it is one beautiful piece of hardware) Hopefully, someone else can chime in to help out with this issue (if its not a bug - which it might be).

clearday
2013-04-15, 08:49
UPDATE: RESOLVED (HOPEFULLY)

"----------------------------------------------------------------------
(0000372) muts (administrator) - 2013-04-15 03:57
http://bugs.kali.org/view.php?id=264#c372
----------------------------------------------------------------------
This is not bug. Postgresql wont install in a Linux Deploy chroot without first
whitelisting it in update-rc.d.

Issue History
Date Modified Username Field Change
================================================== ====================
2013-04-14 11:51 clearday New Issue
2013-04-14 11:51 clearday File Added: attachments.zip
2013-04-15 03:57 muts Note Added: 0000372
2013-04-15 03:57 muts Status new => closed
================================================== ===================="

clearday
2013-04-15, 08:49
No problem. Thanks for trying.


I apologize, I'm am not sure where the error is coming from at this point. Not to familiar with how Kali is working on devices like the Note 2 (Though I must admit, it is one beautiful piece of hardware) Hopefully, someone else can chime in to help out with this issue (if its not a bug - which it might be).

clearday
2013-04-15, 09:03
By the way, does anyone know how to whitelist postgresql in init.d?

#!/bin/sh
set -e

### BEGIN INIT INFO
# Provides: postgresql
# Required-Start: $local_fs $remote_fs $network $time
# Required-Stop: $local_fs $remote_fs $network $time
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PostgreSQL RDBMS server
### END INIT INFO

# Setting environment variables for the postmaster here does not work; please
# set them in /etc/postgresql/<version>/<cluster>/environment instead.

[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0

charonsecurity
2013-04-16, 06:11
I'm not sure as I've never ran into like this but maybe we can try:
update-rc.d postgresql defaults
or
update-rc.d postgresql enable

I'm learning this issue just as you are now. :) Let us know.

clearday
2013-04-16, 11:14
I'm not sure as I've never ran into like this but maybe we can try:
update-rc.d postgresql defaults
or
update-rc.d postgresql enable

I'm learning this issue just as you are now. :) Let us know.

Tried both commands, but no go. Here is the output:

Setting up postgresql-common (134wheezy3) ...
supported_versions: WARNING: Unknown Debian release: Kali Linux 1.0
Starting PostgreSQL 9.1 database server: mainThe PostgreSQL server failed to start. Please check the log output: 2013-04-16 07:09:43 EDT LOG: could not create IPv6 socket: Permission denied 2013-04-16 07:09:43 EDT LOG: could not create IPv4 socket: Permission denied 2013-04-16 07:09:43 EDT WARNING: could not create listen socket for "localhost" 2013-04-16 07:09:43 EDT FATAL: could not create any TCP/IP sockets ... failed!
failed!
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-9.1:
postgresql-9.1 depends on postgresql-common (>= 115~); however:
Package postgresql-common is not configured yet.

dpkg: error processing postgresql-9.1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-9.1; however:
Package postgresql-9.1 is not configured yet.

dpkg: error processing postgresql (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
postgresql-common
postgresql-9.1
postgresql
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@localhost:~#

N13t0
2013-04-24, 19:02
I am having the same problem when i try to install postgresql, and
Update-rc.d postgresql defaulta/enable
Is not working too, some suggestion? About how to whitelisting it in update-rc.d. .???

antoniol
2013-06-27, 20:43
ok first you need to edit update-rc.d and add postgresql to whitelist and comment in blacklist
nano /usr/sbin/update-rc.d
# Blacklist
# postgresql disabled (comment)

#Whitelist
postgresql enabled (add)
-----
than you need to grand permisson of postgresql
usermod -a -G aid_inet postgres
service postgresql start

reboot kali

than start apt-get update && apt-get upgrade
than if you didn't install metasploit run apt-get install metasploit-framework

enjoy

root1234
2016-03-14, 09:42
I didn't understand your tried can u do more details.

Phreya
2016-03-14, 10:03
Dude, read one reply above yours... it's right there.

root1234
2016-03-14, 10:34
I am not English so I didn't get it again sorry for that

root1234
2016-03-14, 10:38
root@kali:~# service postgresql stop
[ ok ] Stopping PostgreSQL 9.4 database server: main.
root@kali:~# service postgresql start
[....] Starting PostgreSQL 9.4 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2016-03-14 10:34:59 UTC [16509-1] FATAL: could not create shared memory segment: Function not implemented 2016-03-14 10:34:59 UTC [16509-2] DETAI[FAILiled system call was shmget(key=5432001, size=40, 03600). ... failed!
failed!
root@kali:~#

root1234
2016-03-14, 11:32
I know that Postgresql won't work on a chroot environment without whitelisting it.
But how I do that

Phreya
2016-03-14, 12:53
Like I said, one reply above yours.. you had the answer...


https://forums.kali.org/showthread.php?1950-postgresql-9-1-errors-after-installing-a-package&p=24551&viewfull=1#post24551

root1234
2016-03-14, 23:13
never did figure out how to whitelist postgresql. You tried to help with updating update-rc.d. Muts never bothered to explain how to actually do to it.

Phreya
2016-03-15, 06:52
That's how you whitelist it.....

root1234
2016-03-16, 13:43
I think that i got it now

root1234
2016-03-16, 13:45
And thanks for your help.