前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >How to Set Systemd Startup Script for Bitcoind?

How to Set Systemd Startup Script for Bitcoind?

作者头像
happy123.me
发布2020-12-31 10:44:19
4510
发布2020-12-31 10:44:19
举报
文章被收录于专栏:乐享123乐享123

setup bitcoind.service

1

vim /etc/systemd/system/bitcoind.service

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

[Unit] Description=Bitcoin daemon After=network.target [Service] ExecStart=/opt/node/bitcoin/bin/bitcoind -daemon -conf=/opt/node/bitcoin/blockdata/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid # Creates /run/bitcoind owned by bitcoin RuntimeDirectory=bitcoind RuntimeDirectoryPreserve=yes User=ubuntu Type=forking PIDFile=/run/bitcoind/bitcoind.pid Restart=on-failure StandardOutput=/var/log/bitcoind.log StandardError=/var/log/bitcoind.log # Hardening measures #################### # Provide a private /tmp and /var/tmp. PrivateTmp=true # Mount /usr, /boot/ and /etc read-only for the process. ProtectSystem=full # Disallow the process and all of its children to gain # new privileges through execve(). NoNewPrivileges=true # Use a new /dev namespace only populated with API pseudo devices # such as /dev/null, /dev/zero and /dev/random. PrivateDevices=true [Install] WantedBy=multi-user.target

Reload systemctl daemon

1

systemctl daemon-reload

Enabled new bitcoind service

1

systemctl enable bitcoind

Commands to start or stop the service

1 2

systemctl stop bitcoind systemctl start bitcoind

Show service status

1

systemctl status bitcoind.service

More info in:

https://github.com/bitcoin/bitcoin/tree/master/contrib/init

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • setup bitcoind.service
  • Reload systemctl daemon
  • Enabled new bitcoind service
  • Commands to start or stop the service
  • Show service status
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档