2 # Distributed under the terms of the GNU General Public License, v2 or later
5 PIDFILE="${DOGECOIN_DATADIR}/dogecoind.pid"
7 DOGECOIN_OPTS="-daemon -pid=${DOGECOIN_DATADIR}/dogecoind.pid -datadir=${DOGECOIN_DATADIR} ${DOGECOIN_OPTS}"
14 if [[ "${DOGECOIN_USERDIR}" == "" ]] ; then
15 eerror "Please edit /etc/conf.d/dogecoind"
16 eerror "A userdir must be specified."
20 if [[ "${DOGECOIN_DATADIR}" == "" ]] ; then
21 eerror "Please edit /etc/conf.d/dogecoind"
22 eerror "A datadir must be specified."
26 if [[ "${DOGECOIN_CONFFILE}" == "" ]] ; then
27 eerror "Please edit /etc/conf.d/dogecoind"
28 eerror "A conffile must be specified."
32 if [[ "${DOGECOIN_USER}" == "" ]] ; then
33 eerror "Please edit /etc/conf.d/dogecoind"
34 eerror "A user must be specified to run dogecoind as that user."
35 eerror "Modify USER to your needs (you may also add a group after a colon)"
38 if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${DOGECOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
39 eerror "Please edit /etc/conf.d/dogecoind"
40 eerror "Specified user must exist!"
43 if `echo "${DOGECOIN_USER}" | grep ':' -sq` ; then
44 if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${DOGECOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
45 eerror "Please edit /etc/conf.d/dogecoind"
46 eerror "Specified group must exist!"
50 if ! grep -q '^rpcpassword=' "${DOGECOIN_CONFFILE}"; then
51 eerror "Please edit `readlink -f ${DOGECOIN_CONFFILE}`"
52 eerror "There must be at least a line assigning rpcpassword=something-secure"
55 if ! stat -Lc '%a' "${DOGECOIN_CONFFILE}" | grep -q '^[4567]00$'; then
56 eerror "`readlink -f ${DOGECOIN_CONFFILE}` should not be readable by other users"
63 checkconfig || return 1
64 ebegin "Starting Dogecoind daemon"
75 ebegin "Stopping Dogecoin daemon"
87 --start --user "${DOGECOIN_USER}" --name dogecoind \
88 --pidfile "${PIDFILE}" \
89 --env HOME="${DOGECOIN_USERDIR}" --exec /usr/bin/dogecoind \
90 --nicelevel "${NICELEVEL}" \
97 start-stop-daemon --stop --user "${DOGECOIN_USER}" \
98 --name dogecoind --pidfile "${PIDFILE}" \
106 --start --user "${DOGECOIN_USER}" --name dogecoind \
107 --pidfile "${PIDFILE}" \
108 --env HOME="${VARDIR}" --exec /usr/bin/dogecoind \
109 --chuid "${DOGECOIN_USER}" \
110 --nicelevel "${NICELEVEL}" \
118 --user "${DOGECOIN_USER}" \
120 --pidfile "${PIDFILE}"