On Tue, Oct 04, 2011 at 01:26:09AM -0700, dormando <[email protected]> wrote:
> I don't have a systemd setup available; is there anyone who could verify
> the script for me and give it a +1? If so it should go into 1.4.9, no
> problem :)

I asked on #systemd on IRC for review, and changed two details:

- given that the process does not fork, no need for pidfile
- replaced $FOO with ${FOO} where a single parameter is expected

Updated patch attached.

Thanks,

Miklos
From f506ab8c8d9eb4d1e84ee149e52030f654bbf280 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <[email protected]>
Date: Sat, 24 Sep 2011 11:57:03 +0200
Subject: [PATCH] Add systemd service file

---
 scripts/memcached.service |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
 create mode 100644 scripts/memcached.service

diff --git a/scripts/memcached.service b/scripts/memcached.service
new file mode 100644
index 0000000..e896dd7
--- /dev/null
+++ b/scripts/memcached.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=memcached daemon
+After=network.target
+
+[Service]
+EnvironmentFile=/etc/sysconfig/memcached
+ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c 
${MAXCONN} $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
-- 
1.7.6

11:21 < vmiklos> http://article.gmane.org/gmane.comp.web.cache.memcached/13472 
<- if someone has a few minutes to give it a review, that would be great :)
11:24 -!- Apetrini [[email protected]] has quit [Read 
error: Connection reset by peer]
11:40 -!- Apetrini [[email protected]] has joined #systemd
11:44 < MK_FG> vmiklos, I think it'd be better to use ${VAR} notation for 
everything but $OPTIONS, so PORT="123 -u someuser" won't pass three arguments 
and will result in proper error
11:45 < MK_FG> Also, why do you pass -P pidfile? It's not used anyway
11:47 < vmiklos> MK_FG: oh, indeed the pidfile is not necessary.
11:47 < vmiklos> $OPTIONS would be a problem, given existing 
/etc/sysconfig/memcached configs
11:48 < vmiklos> i'll resend a service file without pidfile in a bit.
11:48 < MK_FG> I didn't mean to remove them
11:48 < MK_FG> Rather use "-p ${PORT} -u ${USER}  -m ${CACHESIZE} -c ${MAXCONN} 
$OPTIONS"
11:49 < MK_FG> So other args but OPTIONS won't be expanded to several arguments
11:49 < vmiklos> ah, i see :)
11:49 < vmiklos> that make sense, will do that

Attachment: pgp4O2y6xUwAq.pgp
Description: PGP signature

Reply via email to