SK-Yang / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Memcache start up scripts don't come with no daemon option for things like "supervisor" #203

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Remove -d from the config file
2.Run the script /usr/share/memcached/scripts/start-memcached
3.Script still forks

What is the expected output? What do you see instead?
Although this might be expected, it should really provide another script which 
won't daemonize/fork.

What version of the product are you using? On what operating system?
 root@mysql01.internal [/home/foxx] > uname -a
Linux mysql01.internal 2.6.32.28-grsec #2 SMP Wed Feb 16 00:15:12 GMT 2011 
x86_64 GNU/Linux
 root@mysql01.internal [/home/foxx] > cat /etc/issue
Debian GNU/Linux 6.0 \n \l
 root@mysql01.internal [/home/foxx] > memcached -h
memcached 1.4.5

Please provide any additional information below.
Create a new script called: 
/usr/share/memcached/scripts/start-memcached-nodaemon

See attached script. Works perfectly with supervisor, as long as you remove -d 
from the config options.

Original issue reported on code.google.com by foxx%fox...@gtempaccount.com on 15 Apr 2011 at 2:27

Attachments:

GoogleCodeExporter commented 9 years ago
Oh, and for those who have come across this page cos they were having problems 
with supervisor + memcache.. Here is the config I used:

-----
[program:memcached]
command=/usr/share/memcached/scripts/start-memcached-nodaemon

user=root
autostart=true
autorestart=true
stdout_logfile=/var/log/memcached.stdout.log
redirect_stderr=true
stopsignal=QUIT
-----

 root@mysql01.internal [/etc/supervisor/conf.d] > supervisorctl
supervisor> reread
memcached: available
supervisor> update
memcached: added process group
supervisor> reread
No config updates to processes
supervisor> update
supervisor> status
memcached                        BACKOFF    Exited too quickly (process log may 
have details)
supervisor> tail memcached
Only root wants to run start-memcached.
Only root wants to run start-memcached.
Only root wants to run start-memcached.

supervisor> reread
memcached: changed
supervisor> update
memcached: stopped
memcached: updated process group
supervisor> status
memcached                        BACKOFF    Exited too quickly (process log may 
have details)
supervisor> start memcached
memcached: ERROR (abnormal termination)
supervisor> status
memcached                        BACKOFF    Exited too quickly (process log may 
have details)
supervisor> tail memcached
Only root wants to run start-memcached.
Only root wants to run start-memcached.
Only root wants to run start-memcached.
Only root wants to run start-memcached.
failed to listen on TCP port 11211: Address already in use
failed to listen on TCP port 11211: Address already in use
failed to listen on TCP port 11211: Address already in use
failed to listen on TCP port 11211: Address already in use
failed to listen on TCP port 11211: Address already in use
failed to listen on TCP port 11211: Address already in use
failed to listen on TCP port 11211: Address already in use

supervisor> status
memcached                        FATAL      Exited too quickly (process log may 
have details)
supervisor> start memcached
memcached: started
supervisor> status
memcached                        RUNNING    pid 6642, uptime 0:00:02
supervisor>

Original comment by foxx%fox...@gtempaccount.com on 15 Apr 2011 at 2:35

GoogleCodeExporter commented 9 years ago
Why wouldn't you just start memcached directly from supervisor instead of 
putting what is effectively init's config into your config?

Original comment by dsalli...@gmail.com on 15 Apr 2011 at 4:33

GoogleCodeExporter commented 9 years ago
Because then the config has to be maintained from supervisor config.. to keep 
consistency (and to even give it a remote shot at getting included into a 
release), this method allows the config to be kept in the designated place 
(/etc/memcached.conf).

Original comment by foxx%fox...@gtempaccount.com on 15 Apr 2011 at 4:36

GoogleCodeExporter commented 9 years ago
Hmm...  These scripts are meant to be used for system init style things.  We 
need a separate config for things that aren't init scripts.  I don't think it 
makes sense to try to make an init script that isn't run as an init script 
sometimes.

That doesn't invalidate this bug.  Unfortunately, that config is for the init 
script, not for memcached itself.  We should clarify that somewhat.

Original comment by dsalli...@gmail.com on 18 Jul 2011 at 4:07

GoogleCodeExporter commented 9 years ago
Not really sure what to do with this. create a separate script that will parse 
options, but not do all the STD* redirecting? Would that work?

Original comment by dorma...@rydia.net on 8 Aug 2011 at 6:23

GoogleCodeExporter commented 9 years ago
Anyone have any opinions on this thread? I'd love to close this thing.

Original comment by dorma...@rydia.net on 14 Jul 2012 at 11:48