-
Notifications
You must be signed in to change notification settings - Fork 327
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
Deal with absolute paths to log files #1756
base: develop
Are you sure you want to change the base?
Conversation
src/helper/UserSession.cpp
Outdated
? mainConfig.X11.SessionLogFile.get() | ||
: mainConfig.Wayland.SessionLogFile.get()); | ||
QString sessionLog; | ||
if ( (sessionType == QLatin1String("x11")) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can invert this and check for wayland
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A colleague of mine noted that this is session type (x11 or wayland), not x11/x11-user/wayland, sorry. I've fixed the code and the commit message.
LGTM but I wonder whether there is any use for absolute paths other than |
9e19126
to
5dcd028
Compare
It's a good question, but maybe someone would want to configure autologin and write logs to somewhere ouside of user home directory. Actually I did all that to set X11.SessionCommand "/usr/bin/systemd-cat /usr/share/X11/xdm/Xsession" by default in ROSA Linux package (https://abf.io/import/sddm). I dislike logging into files and want logs to be stored in systemd-journald as in gdm. |
Sounds like a better feature. Just not redirecting at all should do the trick, because sddm already outputs into the journal. |
Hm, thanks for noting this, I did not notice that sddm already outputs into the journal even without systemd-cat, maybe I tried an old version |
SDDM itself does, but for the session it redirects the output to a file so that is lost. It could be configurable whether it redirects at all. Or sddm-helper could learn how to communicate with systemd to log into the user journal. Not sure how involved that would be. |
Seems that my mind is messed up. systemd-cat does not make stderr in e.g. openbox to appear in journald. Byt it appears both with and wihtout it in KDE, probably because KDE does it itself (or by running apps via systemd). |
Yes, Plasma itself and everything started by it runs as/within systemd units |
Which DE can it be tested with? I tried openbox, SessionLogFile (not /dev/null) is empty... |
5dcd028
to
38071a2
Compare
If path begins with "/", consider it to be an absolute path, not relative to $HOME Example: SessionLogFile=/dev/null Co-authored-by: Artem Proskurnev <ProskurnevAS@edu.mos.ru> (@temaps) Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
38071a2
to
e9395db
Compare
Most small DEs should work, there any started application should have that as stdout+stderr |
Thinking out loud: On my Arch box sddm-helper is running as root. So I wonder if allowing for absolute path can backfire in some odd way - say my mistake you set Does that make sense? Or I guess the proper way forward is to run all sddm programs as non-root? |
That's basically #1756 (comment)
The logfile is opened after setuid, so permission checks are done as the target user. |
If path begins with "/", consider it to be an absolute path, not relative to $HOME
Example: SessionLogFile=/dev/null
Co-authored-by: Artem Proskurnev ProskurnevAS@edu.mos.ru (@temaps)
Signed-off-by: Mikhail Novosyolov m.novosyolov@rosalinux.ru