Open SnAFKe opened 3 months ago
I just tested it and it works fine.
Ensure permissions where the log file is, directory may not have write permissions to user running xmrig. Or, "touch" the file and set wide open permissions on it so xmrig can append.
you can also use a systemctl service to track logs
I just tested it and it works fine.
Ensure permissions where the log file is, directory may not have write permissions to user running xmrig. Or, "touch" the file and set wide open permissions on it so xmrig can append.
Already done before and working fine is not permision issue or whatever.
Other report same issue i had https://github.com/xmrig/xmrig/issues/3455
you can also use a systemctl service to track logs
Already do that and i don't like journal.
Ahh, the actual --background
option. There are myriad ways to run a thing in the background (screen, systemd, nohup...) so I didn't connect that it was the literal built-in option (which I have never once used so its existence was not at top of mind).
I will look into that.
I'm not sure if you understand my issue.
I had already systemd script which point to config file and config file i set background and log-file option.
Other guy have same issue as me, he do it in command line which is currently the same.
What is the point of using --background
when a systemd service is already in the background?
I never able to run xmrig in background with systemd and the only option i can do this is with --background.
Also what i say before, logs i don't like logs in the journal i perfer use log file.
Then make an appropriate service file (/lib/systemd/system/xmrig.service
):
[Unit]
Description=xmrig
After=network-online.target systemd-modules-load.service
Wants=network-online.target systemd-modules-load.service
AssertFileNotEmpty=/opt/xmrig/config.json
[Service]
Type=simple
User=root
Group=root
Restart=always
KillSignal=SIGINT
LimitMEMLOCK=8G
WorkingDirectory=/opt/xmrig
StandardOutput=null
StandardError=null
SyslogIdentifier=xmrig
TimeoutStartSec=30s
TimeoutStopSec=15s
ExecStart=/opt/xmrig/xmrig
[Install]
WantedBy=multi-user.target
When the StandardOutput
and StandardErrror
are set null it will just throw away any output and not journal it.
This runs xmrig in the background just fine without using xmrig --background
option ("background": false,
in config.json), and log-file will work.
Also I traced all the xmrig code and log messages are sent to uv_fs_write just like they are when it's not forked to background, so the bug must be within libuv somehow. Above my paygrade.
Oh also this is an issue upstream so complain there or bump the issue you linked. It's not a MoneroOcean bug.
Commit that probably broke it: https://github.com/xmrig/xmrig/commit/688d4f5ee16fab4d7153c0c92005925b4dd0f008
Looking for more deep because was working fine before i finally see where is come this "problem"
This is the last build working fine v6.21.1-mo1/v6.21.1. Start build v6.21.2-mo1/v6.21.2 is where come the issue, the commit you link was in v6.21.3 may or may not be related, but what i can see is started in v6.21.2.
Has been fixed in upstream dev
branch, will be in next upstream master
release (whenever that is).
Describe the bug Logs not working if you setup as background mode
To Reproduce Run xmrig as backgroud with log file setup
Expected behavior It should run just fine.
Required data