Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1description "Bitcoin Core Daemon"3start on runlevel [2345]4stop on starting rc RUNLEVEL=[016]6env BITCOIND_BIN="/usr/bin/bitcoind"7env BITCOIND_USER="bitcoin"8env BITCOIND_GROUP="bitcoin"9env BITCOIND_PIDDIR="/var/run/bitcoind"10# upstart can't handle variables constructed with other variables11env BITCOIND_PIDFILE="/var/run/bitcoind/bitcoind.pid"12env BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf"13env BITCOIND_DATADIR="/var/lib/bitcoind"15expect fork17respawn18respawn limit 5 12019kill timeout 60021pre-start script22# this will catch non-existent config files23# bitcoind will check and exit with this very warning, but it can do so24# long after forking, leaving upstart to think everything started fine.25# since this is a commonly encountered case on install, just check and26# warn here.27if ! grep -qs '^rpcpassword=' "$BITCOIND_CONFIGFILE" ; then28echo "ERROR: You must set a secure rpcpassword to run bitcoind."29echo "The setting must appear in $BITCOIND_CONFIGFILE"30echo31echo "This password is security critical to securing wallets "32echo "and must not be the same as the rpcuser setting."33echo "You can generate a suitable random password using the following "34echo "command from the shell:"35echo36echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"37echo38echo "It is recommended that you also set alertnotify so you are "39echo "notified of problems:"40echo41echo "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \43echo44exit 145fi47mkdir -p "$BITCOIND_PIDDIR"48chmod 0755 "$BITCOIND_PIDDIR"49chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_PIDDIR"50chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_CONFIGFILE"51chmod 0660 "$BITCOIND_CONFIGFILE"52end script54exec start-stop-daemon \55--start \56--pidfile "$BITCOIND_PIDFILE" \57--chuid $BITCOIND_USER:$BITCOIND_GROUP \58--exec "$BITCOIND_BIN" \59-- \60-pid="$BITCOIND_PIDFILE" \61-conf="$BITCOIND_CONFIGFILE" \62-datadir="$BITCOIND_DATADIR" \63-disablewallet \64-daemon
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.