Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i'm configuring my debian server and i don't manage to start a daemon correctly.

In order to start, my daemon has to find the Postgresql socket (located at /var/run/postgresql/.s.PGSQL.5432), but the daemon doesn't start. I checked the logs, it's written:

An error occured while loading the map layer: could not connect to server: No such file or directory. Is the server running locally and accepting connections n Unix domain socket '/var/run/postgresql/.s.PGSQL.5432' ?

At first, i used update-rc.d mydaemon defaults, and since the result was like that, i've tried update-rc.d mydaemon start 30 2 3 4 5 . stop 30 0 1 6 ., but the result is still the same.

I'm using Debian 6.0.6 (Squeeze), and postgre "rc.d start level" seems to be 23 since ls /etc/rc3.d | grep postgre returns S23postgresql.

rc.d script metainfo:

# Provides:          mydaemon                                                                                                                           
# Required-Start:    $remote_fs                                                                                                                        
# Required-Stop:     $remote_fs                                                                                                                        
# Default-Start:     2 3 4 5                                                                                                                           
# Default-Stop:      0 1 6                                                                                                                             
# Short-Description: mydaemon daemon                                                                                                           
# Description:       mydaemon daemon. 

Can anyone help me?

Thanks.

(and sorry for my english)

share|improve this question
1  
Please edit your question providing Debian version, and the current "rc.d start level" of postgresql (is it really 29?!?). –  kubanczyk Nov 9 '12 at 16:14
    
Edit done! Debian 6.0.6 Squeeze, postgre "rc.d start level" seems to be 23. –  Lght Nov 12 '12 at 8:26

2 Answers 2

Try to add metainfo in your rc-script like this (example from exim4 rc-script, your configuration will differ from this, check out the insserv documentation):

### BEGIN INIT INFO
# Provides:          exim4
# Required-Start:    $remote_fs $syslog $named $network $time
# Required-Stop:     $remote_fs $syslog $named $network
# Should-Start:      postgresql mysql clamav-daemon greylist spamassassin
# Should-Stop:       postgresql mysql clamav-daemon greylist spamassassin
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: exim Mail Transport Agent
# Description:       exim is a Mail Transport agent
### END INIT INFO

This metainfo is used by the insserv to setup your script in needed place of boot sequence.

share|improve this answer
    
I updated my post so you can see my metainfo, and i will try this when my server will be able to reboot. The should-start should be the solution ;-) –  Lght Nov 15 '12 at 9:30

Lght, try to add 'postgresql' to 'Required-Start' field. Maybe this will help you. This field lets to know insserv to start postgresql before starting your rc-script.

share|improve this answer
    
I have to reconfigure another debian server, using a local computer, in order to solve this problem, so i'll will keep you abreast of this. –  Lght Nov 16 '12 at 10:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.