LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-18-2016, 06:00 AM   #1
iwtbf
Member
 
Registered: Apr 2009
Location: cybernetic space
Distribution: debian
Posts: 42

Rep: Reputation: 1
Question 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?
 
  


Reply

Tags
systemd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: systemd: Using the journal LXer Syndicated Linux News 0 11-12-2015 07:00 AM
Display systemd journal's archived logs JKostaRibeiro Linux - Software 4 07-03-2015 03:40 AM
LXer: Systemd journal provides more informative messages LXer Syndicated Linux News 0 11-19-2012 09:41 AM
Convert init script to systemd file service igor012 Linux - Software 1 10-15-2012 10:05 AM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration