Memcached Daemon Startup Issues

Ivan Voras ivoras at fer.hr
Fri Aug 24 01:51:27 PDT 2007


Peter Pluta wrote:
> 
> 
> Peter Pluta wrote:
>> I installed memcached and since it doesn't have a config file I entered
>> the flags into rc.conf, but when I start it with the rc.d scripts, it
>> always runs as nobody, instead of the user I specified with -u <user>. The
>> man page says "only when run as root". This confuses me somewhat because
>> i'm executing the rc.d script as root, yet it still starts as nobody. I
>> can manually start memcached with "memcached -u memcached -l 127.0.0.1 -p
>> 11211 -m 32 -P /var/run/memcached/memcached.pid". 
>>
>> /etc/rc.conf bit:
>> memcached_enable="YES"
>> memcached_flags='-u memcached -d -l 127.0.0.1 -m 32 -P
>> /var/run/memcached.pid -p 1121'

> Nvm, I had to take a look at the rc script to see that there was another
> directive (memcached_user="")

This is because memcached_user is checked by it's rc.d script and 
defaults to "nobody". Thus, when memcached is started from the script, 
without memcached_user set, it will be run as nobody, not as root, and 
it won't be able to switch to another user by itself.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20070824/1124ac9c/signature.pgp


More information about the freebsd-questions mailing list