FreeBSD Port: postgresql-server-8.0.1

Salvatore Montefusco sm at brightpebbles.org
Mon Feb 14 15:56:22 PST 2005


Hi,
I'm running Freebsd 5.3 and recently installed the 
postgresql-server-8.0.1 port.

Adding custom postgresql_data="/somewhere" in rc.conf, I get an error 
when /urs/local/etc/010.pgsql.sh rc script is launched with the 
commands start, stop, restart, status (except initdb, which works 
fine).

By looking at /urs/local/etc/010.pgsql.sh source and testing it with 
bash -x, I've found out that the problem is caused by $command_args 
variable, which is evaluated before postgresql_data is assigned in 
rc.conf. That's the reason why the script doesn't fail when you call 
initdb: the command doesn't use $command_args.

I've got a workaround by moving $command_args assignment line in to the 
postgresql_command function, before calling su, but actually I don't 
know if it is the right way to solve the problem.

postgresql_command()
{
     command_args="-D ${postgresql_data} ${postgresql_flags} $1"
     su -m ${postgresql_user} -c "exec ${command} ${command_args}"
}

I hope it will be useful. Anyway, you do a great job everyday. Thank 
you and keep going.
Salvatore Montefusco


More information about the freebsd-ports mailing list