Bendr0id / xmrigCC

RandomX, CryptoNight, Argon2 and GhostRider CPU/GPU miner with Command&Control (CC) Server and Monitoring
GNU General Public License v3.0
312 stars 112 forks source link

Problem with Linux systemd script for xmrigCCserver autostart #362

Closed ghost closed 3 years ago

ghost commented 3 years ago

After systemctl start xmrigCCServer I get the following error message:

Jul 25 00:22:00 xmrigcc1 systemd[1]: Starting xmrigCCServer... Jul 25 00:22:00 xmrigcc1 systemd[881]: xmrigCCServer.service: Changing to the requested working directory failed: Permission denied Jul 25 00:22:00 xmrigcc1 systemd[881]: xmrigCCServer.service: Failed at step CHDIR spawning /usr/bin/screen: Permission denied Jul 25 00:22:00 xmrigcc1 systemd[1]: xmrigCCServer.service: Control process exited, code=exited, status=200/CHDIR Jul 25 00:22:00 xmrigcc1 systemd[1]: xmrigCCServer.service: Failed with result 'exit-code'. Jul 25 00:22:00 xmrigcc1 systemd[1]: Failed to start xmrigCCServer. root@xmrigcc1:/home/xmrig/server#

Content of xmrigCCServer.service:

[Unit] Description=xmrigCCServer After=network.target

[Service] User=xmrig
Type=forking KillMode=none ExecStart=/usr/bin/screen -d -m -fa -S xmrig /home/xmrig/server/xmrigServer ExecStop=/usr/bin/killall -w -s 2 /home/xmrig/server/xmrigServer WorkingDirectory=%h

[Install] WantedBy=default.target

screen is installed, System is Debian 10. "xmrig" is the Linux User. `When I install it in root - no error message. But after a reboot: "Please configure admin user and pass to view this Page." ;-)

Bendr0id commented 3 years ago

Is the index.html and the config_cc.json in the same Folder as the xmrigServer binary?

Try adding the path of the config as param.

/usr/bin/screen -d -m -fa -S xmrig /home/xmrig/server/xmrigServer -c /home/xmrig/server/config_cc.json

And try adding the full path of the index.html in the config_cc.json too.

ghost commented 3 years ago

Hello, index.html and config-cc.json is in the same folder as xmrigServer. With config parameter "-c /home/xmrig/server/config_cc.json" - as read above - after reboot shows "Please configure a dashboard" instead of before "Please configure admin user and pass to view this Page." ;-) I don't have much time at the moment, maybe I'll test it again outside of root. The autostart script of the miner works fine. Nevertheless, the Control Center is a great thing! At the moment I'm trying to remaster a USB stick with xmrigCC and FAI.

ghost commented 3 years ago

Hello, the "And try adding the full path of the index.html in the config_cc.json too." was the missing trick ... Thank you!

Bendr0id commented 3 years ago

Great. Will close this then.