Gentoo Archives: gentoo-commits

From: "Anthony G. Basile (blueness)" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-p2p/ppcoind/files: ppcoin.conf ppcoind.logrotate ppcoin.initd ppcoin.confd ppcoin.service
Date: Sun, 01 Dec 2013 15:14:33
Message-Id: 20131201151428.4E7C22004B@flycatcher.gentoo.org
1 blueness 13/12/01 15:14:28
2
3 Added: ppcoin.conf ppcoind.logrotate ppcoin.initd
4 ppcoin.confd ppcoin.service
5 Log:
6 Initial commit
7
8 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)
9
10 Revision Changes Path
11 1.1 net-p2p/ppcoind/files/ppcoin.conf
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.conf?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.conf?rev=1.1&content-type=text/plain
15
16 Index: ppcoin.conf
17 ===================================================================
18 # http://www.bitcoin.org/smf/index.php?topic=644.0
19 #rpcuser=
20 #rpcpassword=
21
22
23
24
25
26
27
28
29 1.1 net-p2p/ppcoind/files/ppcoind.logrotate
30
31 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoind.logrotate?rev=1.1&view=markup
32 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoind.logrotate?rev=1.1&content-type=text/plain
33
34 Index: ppcoind.logrotate
35 ===================================================================
36 /var/lib/ppcoin/.ppcoin/debug.log {
37 weekly
38 sharedscripts
39 postrotate
40 killall -HUP ppcoind
41 endscript
42 }
43
44
45
46 1.1 net-p2p/ppcoind/files/ppcoin.initd
47
48 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.initd?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.initd?rev=1.1&content-type=text/plain
50
51 Index: ppcoin.initd
52 ===================================================================
53 #!/sbin/runscript
54 # Distributed under the terms of the GNU General Public License, v2 or later
55
56 VARDIR="/var/lib/ppcoin"
57 CONFFILE="${VARDIR}/.ppcoin/ppcoin.conf"
58
59 depend() {
60 need net
61 }
62
63 checkconfig() {
64 if [[ "${PPCOIN_USER}" == "" ]] ; then
65 eerror "Please edit /etc/conf.d/ppcoind"
66 eerror "A user must be specified to run ppcoind as that user."
67 eerror "Modify USER to your needs (you may also add a group after a colon)"
68 return 1
69 fi
70 if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
71 eerror "Please edit /etc/conf.d/ppcoind"
72 eerror "Specified user must exist!"
73 return 1
74 fi
75 if `echo "${PPCOIN_USER}" | grep ':' -sq` ; then
76 if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
77 eerror "Please edit /etc/conf.d/ppcoind"
78 eerror "Specified group must exist!"
79 return 1
80 fi
81 fi
82 if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
83 eerror "Please edit `readlink -f ${CONFFILE}`"
84 eerror "There must be at least a line assigning rpcpassword=something-secure"
85 return 1
86 fi
87 if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
88 eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
89 return 1
90 fi
91 return 0
92 }
93
94 start() {
95 checkconfig || return 1
96 ebegin "Starting PPcoind daemon"
97
98 pkg-config openrc
99 if [ $? = 0 ]; then
100 start_openrc
101 else
102 start_baselayout
103 fi
104 }
105
106 stop() {
107 ebegin "Stopping PPcoin daemon"
108
109 pkg-config openrc
110 if [ $? = 0 ]; then
111 stop_openrc
112 else
113 stop_baselayout
114 fi
115 }
116
117 start_openrc() {
118 start-stop-daemon \
119 --start --user "${PPCOIN_USER}" --name ppcoind \
120 --pidfile /var/run/ppcoind.pid --make-pidfile \
121 --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
122 --nicelevel "${NICELEVEL}" \
123 --background \
124 --wait 2000 \
125 -- ${PPCOIN_OPTS}
126 eend $?
127 }
128
129 stop_openrc() {
130 start-stop-daemon --stop --user "${PPCOIN_USER}" \
131 --name ppcoind --pidfile /var/run/ppcoind.pid \
132 --wait 30000 \
133 --progress
134 eend $?
135 }
136
137 start_baselayout() {
138 start-stop-daemon \
139 --start --user "${PPCOIN_USER}" --name ppcoind \
140 --pidfile /var/run/ppcoind.pid --make-pidfile \
141 --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
142 --chuid "${PPCOIN_USER}" \
143 --nicelevel "${NICELEVEL}" \
144 --background \
145 -- ${PPCOIN_OPTS}
146 eend $?
147 }
148
149 stop_baselayout() {
150 start-stop-daemon \
151 --stop \
152 --user "${PPCOIN_USER}" \
153 --name ppcoind \
154 --pidfile /var/run/ppcoind.pid
155 eend $?
156 }
157
158
159
160 1.1 net-p2p/ppcoind/files/ppcoin.confd
161
162 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.confd?rev=1.1&view=markup
163 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.confd?rev=1.1&content-type=text/plain
164
165 Index: ppcoin.confd
166 ===================================================================
167 # Config file for /etc/init.d/ppcoind
168
169 # owner of ppciond process (don't change, must be existing)
170 PPCOIN_USER="ppcoin"
171
172 # See http://www.bitcoin.org/smf/index.php?topic=1063
173 PPCOIN_OPTS="${PPCOIN_OPTS}"
174
175 # nice level
176 NICELEVEL="19"
177
178
179
180 1.1 net-p2p/ppcoind/files/ppcoin.service
181
182 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.service?rev=1.1&view=markup
183 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/ppcoind/files/ppcoin.service?rev=1.1&content-type=text/plain
184
185 Index: ppcoin.service
186 ===================================================================
187 # It's not recommended to modify this file in-place, because it will be
188 # overwritten during package upgrades. If you want to customize, the
189 # best way is to create file
190 # "/etc/systemd/system/ppcoind.service.d/*.conf"
191 # containing your changes
192
193 # For example, if you want to change some daemon and/or unit options,
194 # create a file named
195 # "/etc/systemd/system/ppcoind.service.d/myopts.conf"
196 # containing:
197 # [Service]
198 # Environment="PPCOIN_OPTS=-debug -logtimestamps"
199 # Nice=10
200 # This will override the setting appearing below.
201
202 # Note that almost all daemon options could be specified in
203 # /etc/ppcoin/ppcoin.conf
204
205 [Unit]
206 Description=PPcoin Daemon
207 After=network.target
208
209 [Service]
210 User=ppcoin
211 Environment=PPCOIN_OPTS=
212 ExecStart=/usr/bin/ppcoind -daemon=0 $PPCOIN_OPTS
213 ExecReload=/bin/kill -HUP $MAINPID
214
215 [Install]
216 WantedBy=multi-user.target