LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't access full journalctl from script via systemd service even though user is in systemd-journal group (https://www.linuxquestions.org/questions/linux-newbie-8/cant-access-full-journalctl-from-script-via-systemd-service-even-though-user-is-in-systemd-journal-group-4175572579/)

iwtbf 02-18-2016 06:00 AM

Can't access full journalctl from script via systemd service even though user is in systemd-journal group
 
This might be stupid but here we go.

I am user A on a server and I've added myself to the systemd-journal group and I have a bash script which includes the line

Code:

journalctl --since yesterday > output
Since I've added myself to the systemd-journal group it works as expected when running the script from directly the shell via ./bashscript and I get all info I want from journalctl into the output file.

Now I want to automate the execution of the script so I create a systemd service in /home/A/.config/systemd/user looking like

Code:

[Unit]
Description=bashscript service
After=network.target

[Service]
Type=oneshot
ExecStart=/home/A/bashscript
TimeoutStartSec=1min30s

and an associated timer

Code:

[Unit]
Description= bashscript timeer

[Timer]
OnCalendar=*-*-* 05:55:55
Unit=script.service

[Install]
WantedBy=default.target

Then I enable it via
Code:

systemctl --user enable script.timer
.. and wait a while.

It turns out that it works but with one error. If I look at the journal at the time the timer executes the script I see the following:

Code:

Feb 18 05:56:23 machine script[18959]: Hint: You are currently not seeing messages from other users and the system.
Feb 18 05:56:23 machine script[18959]: Users in the 'systemd-journal' group can see all messages. Pass -q to
Feb 18 05:56:23 machine script[18959]: turn off this notice.

but I want all systeminfo from journalctl like when I execute the script manually. Shouldn't it be enough that user A is in that group?

Any ideas how to fix this?


All times are GMT -5. The time now is 03:29 AM.