Hi all,

I need to launch a handful of memcache instances at boot time as each one 
is addressed to a different development environment, like this:

   1.     /usr/bin/memcached -m 16 -l 0.0.0.0 -p 1 -d -u nobody
   2.     /usr/bin/memcached -m 16 -l 0.0.0.0 -p 2 -d -u nobody
   3.     /usr/bin/memcached -m 16 -l 0.0.0.0 -p 3 -d -u nobody
   4.     /usr/bin/memcached -m 16 -l 0.0.0.0 -p 4 -d -u nobody
   
Now judging from the systemd service:

# cat memcached.service 
> [Unit]
> Description=Memcached 
> Before=httpd.service
> After=network.target
> [Service]
> Type=simple
> EnvironmentFile=-/etc/sysconfig/memcached
> ExecStart=/usr/bin/memcached -u $USER -p $PORT -m $CACHESIZE -c $MAXCONN 
> $OPTIONS
> [Install]
> WantedBy=multi-user.target


It seems this can be easily done as long as the proper variables are set in 
the file */etc/sysconfig/memcached *but of course I might be wrong so my 
question is: can I configure different options for different instances in 
the same configuration file? I know that I can feed different values 
separated by a comma to some options but that would work only for the same 
instance - instead spawning as many instances as i.e. PORTS="1,2,..." are 
set.

As a final resort I can create a service for each instance of memcached 
pointing each one to it's own configuration file - with the added bonus of 
being able to control each instance separately, maybe even adding an 
ExecStop statement - but truth is that I don't need that kind of granular 
control and worst, it will be like accepting my defeat as that's not what I 
have in mind!

Hope you guys can help me shed some light over this puzzle.

Regards,
-Martín

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to