自定义systemd服务无法在Ubuntu 18.04上启动

时间:2018-11-20 22:25:02

标签: systemd bitcoind

在此先感谢您的协助

我为各种加密货币运行原始的QT钱包(基于命令行)。今年早些时候,我将它们设置为自定义的systemd服务,这是非常宝贵的。就像所有常规服务一样,它会启动它们并通过系统将其关闭。我最近发现了一个特别是blackcoin的问题。

该服务过去运行良好(我不知道在发现它之前已经停机了多长时间)

如果我在execstart =命令之后手动运行命令,则一切正常。如果我尝试启动服务(通过systemctl start blackcoin),它将失败,并显示以下服务状态:

blackcoin.service - blackcoin wallet daemon
Loaded: loaded (/etc/systemd/system/blackcoin.service; enabled; vendor preset: enabled)
Active: failed (Result: core-dump) since Tue 2018-11-20 10:44:01 MST; 2h 51min ago
Process: 12272 ExecStart=/usr/bin/blackcoind -datadir=/coindaemon-rundirectory/blackcoin/ -conf=/coindaemon-rundirectory/blackcoin/blackcoin.conf -daemon (code=exited, status=0/SUCCESS)
Main PID: 12283 (code=dumped, signal=ABRT)

Nov 20 10:44:01 knox systemd[1]: blackcoin.service: Service hold-off time over, scheduling restart.
Nov 20 10:44:01 knox systemd[1]: blackcoin.service: Scheduled restart job, restart counter is at 5.
Nov 20 10:44:01 knox systemd[1]: Stopped blackcoin wallet daemon.
Nov 20 10:44:01 knox systemd[1]: blackcoin.service: Start request repeated too quickly.
Nov 20 10:44:01 knox systemd[1]: blackcoin.service: Failed with result 'core-dump'.
Nov 20 10:44:01 knox systemd[1]: Failed to start blackcoin wallet daemon.

这是systemd服务的主体:

##################################################################
##                 Blackcoin Systemd service                    ##
##################################################################
[Unit]
Description=blackcoin wallet daemon
After=network.target

[Service]
Type=forking
User=somedude
RuntimeDirectory=blackcoind
PIDFile=/run/blackcoind/blackcoind.pid
Restart=on-failure
ExecStart=/usr/bin/blackcoind \
   -datadir=/home/somedude/blackcoin/ \
   -conf=/home/somedude/blackcoin/blackcoin.conf \
   -daemon
ExecStop=/usr/bin/blackcoind \
   -datadir=/home/somedude/blackcoin/ \
   -conf=/home/somedude/blackcoin/blackcoin.conf \
    stop

# Recommended hardening

# 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

# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true

[Install]
WantedBy=multi-user.target

这是blackcoin.conf包含的内容:

rpcuser=somedude
rpcpassword=12345 (please don't rob my coins!)

# Wallets
wallet=wallet-blackcoin.dat


pid=/run/blackcoind/blackcoind.pid

rpcport=56111
port=56112

我将继续测试,并将发布我发现的任何新内容。感谢您的光临!

0 个答案:

没有答案