Skip to main content
added info
Source Link
brad
  • 188
  • 6

I am trying to set up bitcoind to start at boot as a specific user. I see the process start for a minute and then fail, following boot.

I can start bitcoin as the user just fine with a login and then just run bitcoind. But I cannot pull the same trick off in a boot script.

journlctl -b

Jun 05 16:43:09 mo.trader.com systemd[1]: bitcoind.service: Start operation timed out. Terminating.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown requested. Exiting.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: In progress...
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z scheduler thread exit
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: done
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Control process exited, code=exited, status=1/FAILURE
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Failed with result 'timeout'.
Jun 05 16:43:11 mo.trader.com systemd[1]: Failed to start bitcoin.

.

cat /etc/systemd/system/bitcoind.service 
[Unit]
Description=bitcoin
#After=network.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes


[Service]
Type=forking
User=bitcoinusr
Group=bitcoinusr

Environment=BITCOIN_PID=/mnt/bitcoin/bitcoin/bitcoind.pid
Environment=BITCOIN_HOME=/home/bitcoinusr/.bitcoin

ExecStart=/usr/local/bin/bitcoind
ExecStop=/bin/kill -15 $MAINPID

[Install]
#WantedBy=multi-user.target
Alias=default.target

.

cat ../bitcoinusr/.bitcoin/bitcoin.conf 
blocksonly=1
dbcache=50
maxorphantx=10
maxmempool=100
datadir=/mnt/bitcoin/bitcoin

How do I get bitcoind to start at boot as user?

UPDATE:

It was a total systemd failure. it actually failed with 'service bitcoind start'. It just took a while to fail out.

I am trying to set up bitcoind to start at boot as a specific user. I see the process start for a minute and then fail, following boot.

I can start bitcoin as the user just fine with a login and then just run bitcoind. But I cannot pull the same trick off in a boot script.

journlctl -b

Jun 05 16:43:09 mo.trader.com systemd[1]: bitcoind.service: Start operation timed out. Terminating.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown requested. Exiting.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: In progress...
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z scheduler thread exit
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: done
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Control process exited, code=exited, status=1/FAILURE
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Failed with result 'timeout'.
Jun 05 16:43:11 mo.trader.com systemd[1]: Failed to start bitcoin.

.

cat /etc/systemd/system/bitcoind.service 
[Unit]
Description=bitcoin
#After=network.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes


[Service]
Type=forking
User=bitcoinusr
Group=bitcoinusr

Environment=BITCOIN_PID=/mnt/bitcoin/bitcoin/bitcoind.pid
Environment=BITCOIN_HOME=/home/bitcoinusr/.bitcoin

ExecStart=/usr/local/bin/bitcoind
ExecStop=/bin/kill -15 $MAINPID

[Install]
#WantedBy=multi-user.target
Alias=default.target

.

cat ../bitcoinusr/.bitcoin/bitcoin.conf 
blocksonly=1
dbcache=50
maxorphantx=10
maxmempool=100
datadir=/mnt/bitcoin/bitcoin

How do I get bitcoind to start at boot as user?

I am trying to set up bitcoind to start at boot as a specific user. I see the process start for a minute and then fail, following boot.

I can start bitcoin as the user just fine with a login and then just run bitcoind. But I cannot pull the same trick off in a boot script.

journlctl -b

Jun 05 16:43:09 mo.trader.com systemd[1]: bitcoind.service: Start operation timed out. Terminating.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown requested. Exiting.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: In progress...
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z scheduler thread exit
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: done
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Control process exited, code=exited, status=1/FAILURE
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Failed with result 'timeout'.
Jun 05 16:43:11 mo.trader.com systemd[1]: Failed to start bitcoin.

.

cat /etc/systemd/system/bitcoind.service 
[Unit]
Description=bitcoin
#After=network.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes


[Service]
Type=forking
User=bitcoinusr
Group=bitcoinusr

Environment=BITCOIN_PID=/mnt/bitcoin/bitcoin/bitcoind.pid
Environment=BITCOIN_HOME=/home/bitcoinusr/.bitcoin

ExecStart=/usr/local/bin/bitcoind
ExecStop=/bin/kill -15 $MAINPID

[Install]
#WantedBy=multi-user.target
Alias=default.target

.

cat ../bitcoinusr/.bitcoin/bitcoin.conf 
blocksonly=1
dbcache=50
maxorphantx=10
maxmempool=100
datadir=/mnt/bitcoin/bitcoin

How do I get bitcoind to start at boot as user?

UPDATE:

It was a total systemd failure. it actually failed with 'service bitcoind start'. It just took a while to fail out.

Source Link
brad
  • 188
  • 6

bitcoind fails to start at boot

I am trying to set up bitcoind to start at boot as a specific user. I see the process start for a minute and then fail, following boot.

I can start bitcoin as the user just fine with a login and then just run bitcoind. But I cannot pull the same trick off in a boot script.

journlctl -b

Jun 05 16:43:09 mo.trader.com systemd[1]: bitcoind.service: Start operation timed out. Terminating.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown requested. Exiting.
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: In progress...
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z scheduler thread exit
Jun 05 16:43:09 mo.trader.com bitcoind[546]: 2020-06-05T15:43:09Z Shutdown: done
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Control process exited, code=exited, status=1/FAILURE
Jun 05 16:43:11 mo.trader.com systemd[1]: bitcoind.service: Failed with result 'timeout'.
Jun 05 16:43:11 mo.trader.com systemd[1]: Failed to start bitcoin.

.

cat /etc/systemd/system/bitcoind.service 
[Unit]
Description=bitcoin
#After=network.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes


[Service]
Type=forking
User=bitcoinusr
Group=bitcoinusr

Environment=BITCOIN_PID=/mnt/bitcoin/bitcoin/bitcoind.pid
Environment=BITCOIN_HOME=/home/bitcoinusr/.bitcoin

ExecStart=/usr/local/bin/bitcoind
ExecStop=/bin/kill -15 $MAINPID

[Install]
#WantedBy=multi-user.target
Alias=default.target

.

cat ../bitcoinusr/.bitcoin/bitcoin.conf 
blocksonly=1
dbcache=50
maxorphantx=10
maxmempool=100
datadir=/mnt/bitcoin/bitcoin

How do I get bitcoind to start at boot as user?