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

Command output is lost #1973

Closed
lilydjwg opened this issue Oct 25, 2023 · 4 comments · Fixed by #1993
Closed

Command output is lost #1973

lilydjwg opened this issue Oct 25, 2023 · 4 comments · Fixed by #1993

Comments

@lilydjwg
Copy link
Contributor

It's very helpful to see what goes wrong when commands spawned from wayfire fails in some way, but wayfire currently discards their output:

wayfire/src/core/core.cpp

Lines 394 to 399 in ada3a6b

int dev_null = open("/dev/null", O_WRONLY);
dup2(dev_null, 1);
dup2(dev_null, 2);
close(dev_null);
_exit(execl("/bin/sh", "/bin/sh", "-c", command.c_str(), NULL));

I'm using lightdm and all output from the compositor is saved in ~/.xsession-errors.

@ammen99
Copy link
Member

ammen99 commented Oct 25, 2023

This is pretty much on purpose, otherwise, logs will get full with random errors. You can always redirect the output to a log file if that's what you want (for example instead of xterm in the command plugin, do xterm &> /tmp/log)

@lilydjwg
Copy link
Contributor Author

logs will get full with random errors

Not that full actually. Even KDE users get their logs into systemd journal. Wayfire users tend to have less applications running and the logs are much less. I have uptime near 10 days now, and ~/.xsession-errors is only 4.8M, most of which are debugging logs from wayfire itself (perhaps mainly added by me).

You can always redirect the output to a log file

But then I need to use one log file per command. I don't want to invent my own log daemon.

@ammen99
Copy link
Member

ammen99 commented Oct 25, 2023

Maybe we can add an option for this, because I definitely prefer the current behavior. What the default is, I am not sure - maybe we could follow the rest of the DEs and output to the log by default. PRs welcome :) (option could be called workarounds/disable_command_output_in_logs or something more fitting if you can think of a better name)

@lilydjwg
Copy link
Contributor Author

Yes, that's what I'm thinking too. I don't care much about the default behavior since I'm going to configure Wayfire after all. I'll try to come up with a patch.

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

Successfully merging a pull request may close this issue.

2 participants