Forum OpenACS Development: problems with Daemontools

Collapse
Posted by Ola Hansson on
I tried to use the Daemontools 0.76 package to manage AOLserver (listening to port 80) but ran into troule on start-up. I typed: svc -u /service/openacs4, which is supposed to bring up my server. /service/openacs4 is linked to the service dir, /home/nsadmin/openacs4 where the ./run script resides.

The error:
[24/Sep/2001:17:18:11][7287.1024][-main-] Notice: modload: loading
'/home/nsadmin/bin/postgres.so'
[24/Sep/2001:17:18:11][7287.1024][-main-] Warning: modload: failed to
load '/home/nsadmin/bin/postgres.so': 'libpq.so.2: cannot load shared
object file: No such file or directory'
[24/Sep/2001:17:18:11][7287.1024][-main-] Error: dbdrv: failed to load
driver 'postgres'
[24/Sep/2001:17:18:11][7287.1024][-main-] Error: dbinit: no such
default pool 'main'
The run script - ./run:
#!/bin/sh
exec /home/nsadmin/bin/nsd -it /home/nsadmin openacs4.tcl -u nsadmin
-g web
There are no problems when I start a simpler service without db pools or when I start the server from the command line (as root):
./bin/nsd -ft openacs4.tcl -u nsadmin -g web

Thanks for your help,
Collapse
Posted by Mat Kovach on
It doesn't look like the enviroment is getting setup correctly.  You have to been watchful when using daemontools and the enviroment that is setup, since it take serveral security precautions and may not setup the enviroment just as you think.  I setup a nsd-<database type> for each server I run from daemontools (ie: nsd-oracle, nsd-postgres) which is basically:

#!/bin/sh
. /etc/profile.postgres
export PATH=$PATH:/usr/local/bin
exec /usr/local/aolserver/bin/nsd $*

/etc/profile.postgres (or profile.oracle) contains all the
proper system variables for that database

/etc/profile.postgres
#!/bin/sh
PATH=$PATH:/usr/local/pgsql/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sfw/lib:/usr/local/pgsql/lib
export PATH LD_LIBRARY_PATH

and then the run directive becomes
#!/bin/sh
exec /usr/local/aolserver/nsd-postgres -u nsadmin -g nsadmin -it /usr/local/aolserver/uptime.tcl

Hope that helps

Collapse
Posted by Ola Hansson on
Thanks Mat! This works fine.

Makes a shorter run directive than using DJB's envdir command, anyhow.