Cannot initialize postgresql

Greetings all,

after successful installation and enabling PostgreSQL service to start on system boot:
Code:
sysrc postgresql_enable=yes
the database initiation fails:
Code:
# /usr/local/etc/rc.d/postgresql initdb
/usr/local/etc/rc.d/postgresql: Permission denied

Any help would be appreciated.

Kindest regards,

M
 
Hi msplsh,

thank you very much for trying to help.

As to your question, no I do have the execuiton bit set. I was trying to trace the problem, so I ran the command as:

Code:
# sh -x /usr/local/etc/rc.d/postgresql initdb

which worked. So, now I am even more confused.

Kindest regards,

M
 
Be careful as I think you are using the instructions from PostgreSQL's web site. iirc, there are Linux-isms there to avoid but there are FreeBSD instructions available which are slightly different.
It's been a long time since I've done this so I can't be much help (though I'll be restarting a pgsql project shortly myself).
 
Please post the output from ls -l /usr/local/etc/rc.d/postgresql
 
Hi drhowarddrfine,

the instructions were copied from the notes upon finishing installation, so I do not think that they were copied for Linux. In fact, Linux uses a different file structure for the different components of the application.

Hi SirDice.

Code:
$ ls -l /usr/local/etc/rc.d/postgresql
-r-xr-xr-x 1 root wheel 3346 Dec 30 21:33 /usr/local/etc/rc.d/postgresql

What really confuses me is why the sh -x command works. From the sh(), the -xoption:
Code:
xtrace
         Write each    command    (preceded by the value of the [I]PS4[/I] variable
         subjected to parameter expansion and arithmetic expansion)    to
         standard error before it is executed.  Useful for debugging.
Kindest regards,

M
 
Back
Top