安装 apt-get install supervisor 默认配置文件好了不需要修改 ubuntu的默认配置文件是 *.conf # command这里的geth 要写全路径 不然会报not such file相关的问题 # 要加上--datadir设置datadir路径,不然会默认为datadir为/root/.ethereum,而这个目录是不存在的进而会mkdir /root/.ethereum但是因为没有这个权限,所以又继续报了权限不足问题 # 要加上--ethash.dagdir 设置ethashdagdir路径,不然会默认为/root/.ethash,而这个目录是不存在的进而会mkdir /root/.ethash但是因为没有这个权限,所以又继续报了权限不足问题 ### 要加上console 2>>/home/blockchain/eth/eth-private/geth.log不然会报invalid command &的错误 很奇怪啊 不明白呢 ### 参考文档: https://blog.csdn.net/wahaha13168/article/details/82467060 vim /etc/supervisor/conf.d/geth.conf [program:geth] command=/usr/bin/nohup /usr/local/go-ethereum/build/bin/geth console 2>>/home/blockchain/eth/eth-private/geth.log --syncmode "fast" --networkid 1 --datadir /mnt/data --cache 4096 --identity "ddblock" --http --http.port 8545 --http.addr 0.0.0.0 --http.api "eth,web3" --http.corsdomain "*" & > /root/nohup.out process_name=%(program_name)s_%(process_num)02d umask=022 startsecs=0 numprocs=1 numprocs_start=1 autostart=true autorestart=true startretries=3 user=root stdout_logfile=/opt/logs/geth.log stderr_logfile=/opt/logs/geth.errer.log