diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-03-16 12:32:07 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-03-16 12:32:21 +0100 |
| commit | f238add26ae1281481c15bdc252d2e4ef8f5a491 (patch) | |
| tree | 6890cba6437a2ee6b6d491c6c4aaa911df6a8236 /contrib/init | |
| parent | Merge pull request #5831 (diff) | |
| parent | startup script for centos, with documentation. (diff) | |
| download | discoin-f238add26ae1281481c15bdc252d2e4ef8f5a491.tar.xz discoin-f238add26ae1281481c15bdc252d2e4ef8f5a491.zip | |
Merge pull request #5847
723664b startup script for centos, with documentation. (joshr)
Diffstat (limited to 'contrib/init')
| -rw-r--r-- | contrib/init/README.md | 1 | ||||
| -rw-r--r-- | contrib/init/bitcoind.init | 67 |
2 files changed, 68 insertions, 0 deletions
diff --git a/contrib/init/README.md b/contrib/init/README.md index d3fa96658..0d19da303 100644 --- a/contrib/init/README.md +++ b/contrib/init/README.md @@ -4,6 +4,7 @@ SystemD: bitcoind.service Upstart: bitcoind.conf OpenRC: bitcoind.openrc bitcoind.openrcconf +CentOS: bitcoind.init have been made available to assist packagers in creating node packages here. diff --git a/contrib/init/bitcoind.init b/contrib/init/bitcoind.init new file mode 100644 index 000000000..db5061874 --- /dev/null +++ b/contrib/init/bitcoind.init @@ -0,0 +1,67 @@ +#!/bin/bash +# +# bitcoind The bitcoin core server. +# +# +# chkconfig: 345 80 20 +# description: bitcoind +# processname: bitcoind +# + +# Source function library. +. /etc/init.d/functions + +# you can override defaults in /etc/sysconfig/bitcoind, see below +if [ -f /etc/sysconfig/bitcoind ]; then + . /etc/sysconfig/bitcoind +fi + +RETVAL=0 + +prog=bitcoind +# you can override the lockfile via BITCOIND_LOCKFILE in /etc/sysconfig/bitcoind +lockfile=${BITCOIND_LOCKFILE-/var/lock/subsys/bitcoind} + +# bitcoind defaults to /usr/bin/bitcoind, override with BITCOIND_BIN +bitcoind=${BITCOIND_BIN-/usr/bin/bitcoind} + +# bitcoind opts default to -disablewallet, override with BITCOIND_OPTS +bitcoind_opts=${BITCOIND_OPTS--disablewallet} + +start() { + echo -n $"Starting $prog: " + daemon $DAEMONOPTS $bitcoind $bitcoind_opts + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $prog + ;; + restart) + stop + start + ;; + *) + echo "Usage: service $prog {start|stop|status|restart}" + exit 1 + ;; +esac |