I'm developing an Oracle-based website in PHP (on Linux). I've written a small PHP script to process entries from a queue in the database. I'd like the script to run unattended and process whatever I put in the queue efficiently. It currently picks up 1000 rows per execution.
I'm trying to run this script from init like so:
q0:3:respawn:/path/to/processor.php
Which successfully launches the program, but init doesn't load my environment settings, so I had to add a putenv("ORACLE_HOME=...") to make it connect.
At the moment the script works as expected when run by root from bash. But under init when it tries to retrieve data I get:
Warning: ociexecute(): OCIStmtExecute: ORA-03106: fatal two-task communication protocol error in (filename, line)
I've tried setting TNS_ADMIN, NLS_LANG, and others but can't figure out what's missing.
The real question is this: what could the relevant difference be between running from bash and running from init?