Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs not works anymore #145

Open
SnAFKe opened this issue Jun 2, 2024 · 12 comments
Open

Logs not works anymore #145

SnAFKe opened this issue Jun 2, 2024 · 12 comments

Comments

@SnAFKe
Copy link

SnAFKe commented Jun 2, 2024

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

  • XMRig version
    • 6.21.3-mo15
  • OS: Linux x64
@Spudz76
Copy link

Spudz76 commented Jun 2, 2024

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.

@realsetvin
Copy link

you can also use a systemctl service to track logs

@SnAFKe
Copy link
Author

SnAFKe commented Jun 2, 2024

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 xmrig#3455

you can also use a systemctl service to track logs

Already do that and i don't like journal.

@Spudz76
Copy link

Spudz76 commented Jun 2, 2024

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.

@SnAFKe
Copy link
Author

SnAFKe commented Jun 2, 2024

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.

@Spudz76
Copy link

Spudz76 commented Jun 2, 2024

What is the point of using --background when a systemd service is already in the background?

@SnAFKe
Copy link
Author

SnAFKe commented Jun 2, 2024

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.

@Spudz76
Copy link

Spudz76 commented Jun 2, 2024

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.

@Spudz76
Copy link

Spudz76 commented Jun 2, 2024

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.

@Spudz76
Copy link

Spudz76 commented Jun 2, 2024

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: xmrig@688d4f5

@SnAFKe
Copy link
Author

SnAFKe commented Jun 3, 2024

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.

@Spudz76
Copy link

Spudz76 commented Jun 4, 2024

Has been fixed in upstream dev branch, will be in next upstream master release (whenever that is).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants