-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
startup script for centos, with documentation.
- Loading branch information
1 parent
10a3ff0
commit 723664b
Showing
3 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters