Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/memcached/files/1.2.4: init conf
Date: Tue, 27 Nov 2007 01:22:27
Message-Id: E1Iwp9V-0003aT-3b@stork.gentoo.org
1 robbat2 07/11/27 01:22:17
2
3 Added: init conf
4 Log:
5 Version bump to upstream release candidate. Also include the updated scripts with multiconf support per bug #194868. Multiconf was possible before, but the PIDFILE was not always handled correctly.
6 (Portage version: 2.1.3.19)
7
8 Revision Changes Path
9 1.1 net-misc/memcached/files/1.2.4/init
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/memcached/files/1.2.4/init?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/memcached/files/1.2.4/init?rev=1.1&content-type=text/plain
13
14 Index: init
15 ===================================================================
16 #!/sbin/runscript
17 # $Header: /var/cvsroot/gentoo-x86/net-misc/memcached/files/1.2.4/init,v 1.1 2007/11/27 01:22:16 robbat2 Exp $
18
19 CONF="${SVCNAME#*.}"
20 CONFBASE="/etc/conf.d/memcached"
21
22 [ -z "${PIDBASE}" ] && PIDBASE="/var/run/memcached/memcached"
23 [ "${CONF}" == "memcached" ] && CONF=''
24
25 if [ -n "${CONF}" ]; then
26 PIDFILE="${PIDBASE}-${PORT}.${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}-${PORT}.pid"
35 CONFSRC="${CONFBASE}"
36 fi
37
38 depend() {
39 need net
40 }
41
42 checkconfig() {
43 if [ -z "${LISTENON}" ]; then
44 ewarn "You should edit $CONFSRC and specify an address to listen on."
45 ewarn "Listening on any address (check your firewall!)"
46 fi
47
48 }
49
50 start() {
51 if [ -n "${CONF}" ]; then
52 ebegin "Starting memcached (${CONF})"
53 else
54 ebegin "Starting memcached"
55 fi
56 checkconfig
57 local dir="$(dirname ${PIDFILE})"
58 if [ ! -d "${dir}" ]; then
59 einfo " Creating ${dir}"
60 mkdir -p "${dir}"
61 fi
62 chown ${MEMCACHED_RUNAS} "${dir}"
63 if [ -f "${PIDFILE}" ]; then
64 einfo " Removing stale pidfile ${PIDFILE}"
65 rm -f "${PIDFILE}" 1>/dev/null
66 fi
67
68 if [ -z "${LISTENON}" ]; then
69 c_LISTENON=""
70 else
71 c_LISTENON="-l ${LISTENON}"
72 fi
73
74 /sbin/start-stop-daemon --start --pidfile "${PIDFILE}" \
75 --exec "${MEMCACHED_BINARY}" \
76 --startas "${MEMCACHED_BINARY}" -- \
77 -d -p ${PORT} ${c_LISTENON} -m ${MEMUSAGE} \
78 -c ${MAXCONN} -u ${MEMCACHED_RUNAS} -P "${PIDFILE}" \
79 ${MISC_OPTS}
80 eend $?
81 }
82
83 stop() {
84 if [ -n "${CONF}" ]; then
85 ebegin "Stopping memcached (${CONF})"
86 else
87 ebegin "Stopping memcached"
88 fi
89 start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
90 rm -f "${PIDFILE}"
91 eend $?
92 }
93
94
95
96 1.1 net-misc/memcached/files/1.2.4/conf
97
98 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/memcached/files/1.2.4/conf?rev=1.1&view=markup
99 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/memcached/files/1.2.4/conf?rev=1.1&content-type=text/plain
100
101 Index: conf
102 ===================================================================
103 # Copyright 2003 Gentoo Technologies, Inc
104 # $Header: /var/cvsroot/gentoo-x86/net-misc/memcached/files/1.2.4/conf,v 1.1 2007/11/27 01:22:16 robbat2 Exp $
105 # memcached config file
106
107 MEMCACHED_BINARY="/usr/bin/memcached"
108
109 #Specify memory usage in megabytes (do not use letters)
110 #64MB is default
111 MEMUSAGE="64"
112
113 #User to run as
114 MEMCACHED_RUNAS="memcached"
115
116 #Specify maximum number of concurrent connections
117 #1024 is default
118 MAXCONN="1024"
119
120 #Listen for connections on what address?
121 # If this is empty, memcached will listen on 0.0.0.0
122 # be sure you have a firewall in place!
123 LISTENON=""
124
125 #Listen for connections on what port?
126 PORT="11211"
127
128 #PID file location
129 # '-${PORT}.${CONF}.pid' will be appended to this!
130 # You do not normally need to change this.
131 PIDBASE="/var/run/memcached/memcached"
132
133 #Other Options
134 MISC_OPTS=""
135
136
137
138 --
139 gentoo-commits@g.o mailing list