This works for me.
--libpq-conninfo='user=blah dbname=blah_db host=host.com port=5432'
On Wed, Nov 17, 2010 at 3:52 PM, Tim Uckun <timu...@gmail.com> wrote:
> This works for me.
>
> --libpq-conninfo='user=blah dbname=blah_db host=host.com port=5432'
Thanks for your reply, however, trying the following:
PARAMS="-q libpq --libpq-conninfo='user=gearman dbname=gearman
host=localhost port=5432'"
gives me:
gearman_conf_parse_args:Unknown option: dbname=gearman
I should mention that this is gearman 0.12 from the launchpad ppa.
--
Brian Cassidy (brian....@gmail.com)
On Wed, Nov 17, 2010 at 4:09 PM, Tim Uckun <timu...@gmail.com> wrote:
> Can you post your entire script?
Seriously, that's literally everything. the
/etc/default/gearman-job-server file gets slurped in by the init.d
script.
Here's what the daemon launch code of the init.d script looks like
(unmodified from the version that ships with the ppa deb):
start()
{
log_daemon_msg "Starting Gearman Server" "gearmand"
if ! test -d ${PIDDIR}
then
mkdir ${PIDDIR}
chown ${GEARMANUSER} ${PIDDIR}
fi
if start-stop-daemon \
--start \
--exec $DAEMON \
-- --pid-file=$PIDFILE \
--user=$GEARMANUSER \
--daemon \
--log-file=/var/log/gearman-job-server/gearman.log \
$PARAMS
then
log_end_msg 0
else
log_end_msg 1
log_warning_msg "Please take a look at the syslog"
exit 1
fi
}
For completeness, the /etc/default/gearman-job-server file:
# This is a configuration file for /etc/init.d/gearman-job-server; it allows
# you to perform common modifications to the behavior of the gearman-job-server
# daemon startup without editing the init script (and thus getting prompted by
# dpkg on upgrades). We all love dpkg prompts.
# Examples ( from http://gearman.org/index.php?id=manual:job_server )
#
# Use drizzle as persistent queue store
# PARAMS="-q libdrizzle --libdrizzle-db=some_db
--libdrizzle-table=gearman_queue"
#
# Use mysql as persistent queue store
# PARAMS="-q libdrizzle --libdrizzle-host=10.0.0.1 --libdrizzle-user=gearman \
# --libdrizzle-password=secret --libdrizzle-db=some_db \
# --libdrizzle-table=gearman_queue --libdrizzle-mysql"
#
# Missing examples for memcache persitent queue store...
# Parameters to pass to dbus.
PARAMS="-q libpq --libpq-conninfo='user=gearman dbname=gearman'"
--
Brian Cassidy (brian....@gmail.com)
Try it.
As mentioned in my initial message, I am able to shove the options
directly into the init.d script and bypass the "defaults" file
entirely and everything works great (which is what I'm doing now, in
fact). However, the point is, I'd like to use the mechanism in place
for doing custom options rather than dirtying up the init.d script --
if at all possible.
Cheers,
--
Brian Cassidy (brian....@gmail.com)
Sorry it's a little late here so I didn't read your first email
carefully enough.
I just looked at my config files and I have all the params in the
init'd script and not the PARAMS variable. Clearly start-stop-daemon
is doing some crazy escaping thing. Have you tried escaping the
spaces?
I've tried the standard "\ " escaping; no luck (same error as before).
I've even tried to get cheeky with \x20 -- that didn't complain with
an error, but gearman didn't actually load.
Suggestions welcome! :)
--
Brian Cassidy (brian....@gmail.com)
On Wed, Nov 17, 2010 at 8:58 PM, Matt Harrington <quer...@gmail.com> wrote:
> I was never able to get this to work as expected, so I just used the env
> variables. You can prolly put something like this into your config:
>
> export PGDATABASE=gearman
> export PGUSER=gearman
>
> PARAMS="-q libpq"
Awesome! This at least lets me leave the init.d script in pristine
order. Thanks.
> These variables are consumed by libpq and added to your connection string.
> I believe the password could also be handled in this fashion to keep it out
> of the process list. You can find the list of env variables here:
>
> http://www.postgresql.org/docs/8.4/static/libpq-envars.html
I'm actually using a .pgpass file in the /var/lib/gearman/ folder for
that. Seems to work okay.
Thanks again.
--
Brian Cassidy (brian....@gmail.com)
--queue-type Postgres --libpq-conninfo='user=postgres password=SECRET dbname=gearman host=localhost port=5432' --libpq-table=gearman
mind the quotes
--
You received this message because you are subscribed to the Google Groups "Gearman" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gearman+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
export PGHOST=TheHostname
export PGPORT=5432
export PGUSER=gearman
export PGPASSWORD=ThePassword
export PGDATABASE=gearman
PARAMS="--verbose -q libpq --libpq-table=gearmanqueue1 --verbose"
Is there anything that needs to be done to setup the gearman user?