make install-daemon-service

文章详细描述了如何在Linux系统中使用systemd创建和管理LotusDaemon和Miner服务,包括环境变量设置、启动、重启策略以及开机自启动。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

make install-daemon-service
vim /etc/systemd/system/lotus-daemon.service
[Unit]
Description=Lotus Daemon
After=network-online.target
Requires=network-online.target

[Service]
Environment=GOLOG_FILE="/var/log/lotus/daemon.log"
Environment=GOLOG_LOG_FMT="json"
Environment=LOTUS_PATH="/seal/lotus"
ExecStart=/usr/local/bin/lotus daemon
Restart=always
RestartSec=10

MemoryAccounting=true
MemoryHigh=8G
MemoryMax=10G
LimitNOFILE=8192:10240

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start lotus-daemon.service
systemctl status lotus-daemon.service
systemctl enable lotus-daemon.service
cat /etc/systemd/system/lotus-daemon.service
[Unit]
Description=Lotus Daemon
After=network-online.target
Requires=network-online.target

[Service]
Environment=GOLOG_FILE="/var/log/lotus/daemon.log"
Environment=GOLOG_LOG_FMT="json"
Environment=LOTUS_PATH="/seal/lotus"
EnvironmentFile=/seal/lotus_vars.env
ExecStart=/usr/local/bin/lotus daemon
Restart=always
RestartSec=10

#MemoryAccounting=true
#MemoryHigh=8G
#MemoryMax=10G
#LimitNOFILE=8192:10240
LimitNOFILE=1024000:1024000

[Install]
WantedBy=multi-user.target
cat /seal/lotus_vars.env
# LOG
RUST_BACKTRACE=full
RUST_LOG=info

# LOTUS
LOTUS_FVM_CONCURRENCY=24

make install-miner-service

# make install-miner-service
install -C ./lotus-miner /usr/local/bin/lotus-miner
install -C ./lotus /usr/local/bin/lotus
mkdir -p /etc/systemd/system
mkdir -p /var/log/lotus
install -C -m 0644 ./scripts/lotus-daemon.service /etc/systemd/system/lotus-daemon.service
systemctl daemon-reload

lotus-daemon service installed. Don't forget to run 'sudo systemctl start lotus-daemon' to start it and 'sudo systemctl enable lotus-daemon' for it to be enabled on startup.
mkdir -p /etc/systemd/system
mkdir -p /var/log/lotus
install -C -m 0644 ./scripts/lotus-miner.service /etc/systemd/system/lotus-miner.service
systemctl daemon-reload

lotus-miner service installed. Don't forget to run 'sudo systemctl start lotus-miner' to start it and 'sudo systemctl enable lotus-miner' for it to be enabled on startup.

参考

  1. Systemd service files
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值