Gentoo Archives: gentoo-commits

From: "Matt Thode (prometheanfire)" <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/memcached/files: memcached.init memcached.confd
Date: Mon, 23 Dec 2013 00:56:20
Message-Id: 20131223005617.8E9352004F@flycatcher.gentoo.org
1 prometheanfire 13/12/23 00:56:17
2
3 Added: memcached.init memcached.confd
4 Log:
5 update to 1.4.17 and eapi5 and bug 493036
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0x2471eb3e40ac5ac3)
8
9 Revision Changes Path
10 1.1 net-misc/memcached/files/memcached.init
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/memcached/files/memcached.init?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/memcached/files/memcached.init?rev=1.1&content-type=text/plain
14
15 Index: memcached.init
16 ===================================================================
17 #!/sbin/runscript
18
19 CONF="${SVCNAME#*.}"
20 CONFBASE="/etc/conf.d/memcached"
21
22 [ -z "${PIDBASE}" ] && PIDBASE="/run/memcached/memcached"
23 [ "${CONF}" == "memcached" ] && CONF=''
24
25 if [ -n "${CONF}" ]; then
26 PIDFILE="${PIDBASE}.${CONF}.pid"
27 CONFSRC="${CONFBASE}.${CONF}"
28 if [ -f "${CONFSRC}" ]; then
29 source "${CONFSRC}"
30 else
31 eerror "The configuration file $CONFSRC was not found!"
32 fi
33 else
34 PIDFILE="${PIDBASE}.pid"
35 CONFSRC="${CONFBASE}"
36 fi
37
38 depend() {
39 if [ -z "${SOCKET}" ]; then
40 need net
41 fi
42 # per bug #269022, accurate time is important for memcached!
43 # We include the full list of ways it might be set on boot.
44 after ntp-client ntpd rdate openrdate adjtimex hwclock
45 }
46
47 checkconfig() {
48 if [ -z "${LISTENON}" ] && [ -z "${SOCKET}" ]; then
49 ewarn "You should edit $CONFSRC and specify an address or socket to listen on."
50 ewarn "Listening on any address (check your firewall!)"
51 fi
52 }
53
54 start() {
55 if [ -n "${CONF}" ]; then
56 ebegin "Starting memcached (${CONF})"
57 else
58 ebegin "Starting memcached"
59 fi
60 checkconfig
61 local dir="$(dirname ${PIDFILE})"
62 if [ ! -d "${dir}" ]; then
63 einfo " Creating ${dir}"
64 mkdir -p "${dir}"
65 fi
66
67 chown ${MEMCACHED_RUNAS} "${dir}"
68 if [ -f "${PIDFILE}" ]; then
69 einfo " Removing stale pidfile ${PIDFILE}"
70 rm -f "${PIDFILE}" 1>/dev/null
71 fi
72
73
74 if [ -n "${SOCKET}" ]; then
75 CONNECTION="-s ${SOCKET}"
76
77 if [ -n "${SOCKET_MASK}" ]; then
78 CONNECTION="${CONNECTION} -a ${SOCKET_MASK}"
79 fi
80 else
81 CONNECTION="-p ${PORT} -U ${UDPPORT}"
82
83 if [ -n "${LISTENON}" ]; then
84 CONNECTION="${CONNECTION} -l ${LISTENON}"
85 fi
86 fi
87
88 /sbin/start-stop-daemon --start --pidfile "${PIDFILE}" \
89 --exec "${MEMCACHED_BINARY}" -- \
90 -d ${CONNECTION} -m ${MEMUSAGE} \
91 -c ${MAXCONN} -u ${MEMCACHED_RUNAS} -P "${PIDFILE}" \
92 ${MISC_OPTS}
93
94 eend $?
95 }
96
97 stop() {
98 if [ -n "${CONF}" ]; then
99 ebegin "Stopping memcached (${CONF})"
100 else
101 ebegin "Stopping memcached"
102 fi
103
104 start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
105
106 rm -f "${PIDFILE}"
107
108 eend $?
109 }
110
111
112
113 1.1 net-misc/memcached/files/memcached.confd
114
115 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/memcached/files/memcached.confd?rev=1.1&view=markup
116 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/memcached/files/memcached.confd?rev=1.1&content-type=text/plain
117
118 Index: memcached.confd
119 ===================================================================
120 # memcached config file
121
122 MEMCACHED_BINARY="/usr/bin/memcached"
123
124 # Specify memory usage in megabytes (do not use letters)
125 # 64MB is default
126 MEMUSAGE="64"
127
128 # User to run as
129 MEMCACHED_RUNAS="memcached"
130
131 # Specify maximum number of concurrent connections
132 # 1024 is default
133 MAXCONN="1024"
134
135 # Listen for connections on what address?
136 # If this is empty, memcached will listen on 0.0.0.0
137 # be sure you have a firewall in place!
138 LISTENON=""
139
140 # Listen for connections on what port?
141 PORT="11211"
142
143 # Listen for UDP connecitons on what port? 0 means turn off UDP
144 UDPPORT="${PORT}"
145
146 # PID file location
147 # '-${PORT}.${CONF}.pid' will be appended to this!
148 # You do not normally need to change this.
149 PIDBASE="/var/run/memcached/memcached"
150
151 # Socket to listen on
152 #SOCKET="/var/run/memcached/memcached.sock"
153
154 # Socket mask
155 # 0700 is default
156 #SOCKET_MASK="0700"
157
158 # Other Options
159 MISC_OPTS=""