Getting the memcached service to work in OpenSolaris 2009.06

On my default OpenSolaris 2009.06 image I installed memcached with:

pkg install SUNWmemcached

and then tried to get it running with:

svcadm enable memcached

It kept on dieing and respawning and I saw the log file (/var/svc/log/application-database-memcached\:default.log) growing with lines like the following

[ Jun  1 14:42:34 Enabled. ]
[ Jun  1 14:42:34 Executing start method ("/lib/svc/method/memcached start"). ]
can’t run as root without the -u switch
[ Jun  1 14:42:35 Method "start" exited with status 0. ]

So basically memcached was complaining that it was starting as root and not being told to switch to another user.  To fix this I had to tell it to switch to the ‘nobody’ user when starting.  Here are the steps I used:

# tell memcached to run as the user ‘nobody’ and set the max memory to 1024M, you need to at least have

# -u nobody (or some other account that exists on the system)

svccfg -s memcached setprop memcached/options= ‘(“-u” “nobody” “-m” “1024″)’

svcadm refresh memcached

svcadm disable memcached

svcadm enable memcached

The memcached man page in OpenSolaris sort of mentions you need to do this towards the end, but I think it is poor form for the server to be unable to run by using the default SMF configuration.  I will try to get an RFE to at least have the ‘-u nobody’ option set by default.

One Response to “Getting the memcached service to work in OpenSolaris 2009.06”

  1. idanka Says:

    HI!

    opensolaris 2009.06
    svccfg -s memcached setprop memcached/options= ‘(”-u” “nobody” “-m” “1024″)’

    error:
    bash: syntax error near unexpected token `(‘

    what’s the problem?

Leave a Reply


Copyright © 2010 williamhathaway.com. All Rights Reserved.
No computers were harmed in the 0.331 seconds it took to produce this page.

Designed/Developed by Lloyd Armbrust & hot, fresh, coffee.