Questions tagged [systemd-journald]
For questions pertaining to systemd-journald, a system service that collects and stores logging data. Use this tag for questions about systemd-journald itself, using systemd-journald, or questions about issues arising from collecting and storing logging data in systems where this task is performed by systemd-journald.
299 questions
0
votes
1
answer
7
views
Cannot see "file,line,func" fields in the journal
I am trying to use sd_journal_print_with_location() function.
#include <systemd/sd-journal.h>
int main() {
sd_journal_print_with_location(LOG_INFO, "CODE_FILE=tst_file.c", "...
0
votes
1
answer
60
views
How to use python systemd.journal module to log to a newly created systemd journald namespace
The python example here allows me to log to the systemd journal just by adding logger.info("Hi Mom"). I want to log to a different journal namespace with custom/longer data retention period ...
1
vote
0
answers
24
views
Process under systemd (journald) doesn't log stdout?
I have a process that I've written that logs several lines to stdout on startup:
Remote Input Daemon starting...
Creating evdev device... done.
Filling keys list array... done.
Setting up listening ...
0
votes
1
answer
70
views
Get output into journal in a C written service
I have a small service written in C on Debian.
This service automatically starts with Linux and does some file operations and other things as expected.
The service prints some informational messages ...
0
votes
1
answer
47
views
How to tail remote systemd journal files
I've gotten my systemd-journald-remote.service up and running, with (1) test client connecting successfully via systemd-journald-upload.service. When I normally tail journald logs, I use journalctl -...
0
votes
0
answers
19
views
debian and selinux filesystem error with journal
I have debian bookworm and install SELinux and activate it and reboot system. But I get the following error:
0
votes
1
answer
45
views
Why doesn't Journald store kernel messages for as long as other messages are kept?
I have a computer running Fedora Workstation 40 and Systemd 255. For some reason kernel log messages are available in the Journal for much shorter time than other log messages.
user@host:~ $ ...
1
vote
1
answer
54
views
Remote journal over AutoSSH tunnel
I'm having several remote sites (test setups), each having multiple Linux devices, uploading their journal remotely to Raspberry Pis in that remote site. I'm trying to forward these journals via ...
4
votes
2
answers
703
views
How often does systemd journal collect/read logs from sources
I have a program that generates several logs per second and I want to track these logs in real time using the journal, but it seems there is delay for the journal to collect/read logs from the source. ...
0
votes
1
answer
30
views
omit command output on systemd-run
when running systemd-run --pty --same-dir --wait --service-type=exec I get all the command output in journal. While nice, it is not something I want/can afford all the time.
for example, if I want ...
0
votes
0
answers
35
views
JournalD leaving 4GB free while I have specifically configured to leave 20% that is around 25GB?
I have configurad journald with following conf,
[test@mcmillan ~]# cat /etc/systemd/journald.conf
[Journal]
Storage=persistent
Compress=True
RateLimitInterval=1s
RateLimitBurst=10000
SyncIntervalSec=...
0
votes
0
answers
34
views
Systemd instance units with dynamic parameters
I have a server that continuously deploys new version of the application.
systemctl start [email protected] # start new version
systemctl stop [email protected] # shutdown old processes
Is ...
1
vote
0
answers
54
views
Systemd logging to journal stops after service outputs very long lines
I have a process that outputs its logs to standard error, and I'm running it as a systemd service with Type=simple. I have left the StandardError and StandardOutput fields at their default values (...
0
votes
0
answers
27
views
Is it impossible to limit journalctl to a user service?
I am specifically NOT asking about how a user can look at their own logs, I am asking how at root level, where I see user service logs with a plain call to sudo journalctl --output with-unit like so:
...
0
votes
0
answers
49
views
How to force systemd unit to log into journal instead of syslog
For some time now I'm trying to force systemd unit I created to log command output to systemd journal. It logs only to syslog. Here is my config:
$ cat /etc/systemd/system/sf-synchronize.service
[...
0
votes
0
answers
80
views
finding more information on journald failure
System locked up with console full of
systemd-journald[123]: Failed to write entry to /var/log/journal/b5...1c/user-100.journal (29 items, 820 bytes) despite vacuuming, ignoring: input/output error (...
7
votes
2
answers
1k
views
Is it possible to dynamically refresh journalctl with less?
I'm using less to view my journalctl logs because it's more convenient. It doesn't clutter the console window with logs after you exit less and you can scroll using your mouse wheel.
journalctl --unit ...
2
votes
1
answer
338
views
How to continue journal output to serial console after dev-mqueue.mount is started
So far I managed to get the kernel & systemd to output the first log messages from booting on the system’s serial port. Further, after the boot process is (nearly) completed, journald continues to ...
0
votes
0
answers
100
views
How can I force systemd journalctl to output log in sequential order in case of frequent clock changes?
I have a standalone debian-based system that -- for the simplicity -- can be taken as not having RTC. The system clock can be set during operation, both forwards and backwards.
I thought that ...
0
votes
0
answers
80
views
Dnsmasq - Do not log certain queries/websites?
I have dnsmasq logging to my systemd-journal on a machine hosting an apache server. The server is quite busy, causing around 600.000 log lines to accumulate within 4-5 hours. Out of these logs, 94% ...
1
vote
1
answer
99
views
ping output sporadically missing (labeled as wrong unit) in journal of systemd service
I am using ping in a script, which runs in a systemd service unit. The output from ping is sometimes (often) missing in the unit's journal. I.e., it is missing from journalctl --user -u MyUnit.
Note ...
1
vote
1
answer
129
views
Trying to periodically backup /var/log while using journald
I'm trying to periodically backup my /var/log directory, but journald manages the logging on my system. Is the correct way to just tar -cf log.tar /var/log?
The way journald saves it's log files in /...
1
vote
0
answers
781
views
Why jouranlctl uses --utc by default when running without root privigies?
On a host running Ubuntu 20.04 LTS I notice that, by default, journalctl (without root privileges) is the same as journalctl --utc, but with root privileges journalctl honors the time zone (as shown ...
0
votes
0
answers
847
views
systemd-journald.service fails to load during boot
I've accidentally unplugged my NAS and after plugging back it fails to boot because of the following error:
[ 105.556720] systemd[1]: systemd-timesyncd.service: Main process exited, code=killed, ...
0
votes
2
answers
136
views
Journal: which services are filling up the allowed journal-size?
On a Debian machine, by default the systemd-journal is caring about the logs.
It's configuration limits the max disk space it can use:
$ cat /etc/systemd/journald.conf
SystemMaxUse=100M
SystemKeepFree=...
0
votes
0
answers
803
views
systemd, journalctl, and suspend/resume (sleep/wake): marked by default in the logs? Or how to add? And scripting around suspend/resume in general?
(
First of all, I'm not completely sure what the official terms are.
I think it's "suspend"/"resume",
with "sleep"/"wake" being synonyms
(and I'm not sure if ...
0
votes
0
answers
468
views
Audit Logging Discrepancy: Journald vs Rsyslog
After installing Debian 12 and rsyslog 8.2302 (for TLS remote syslog), I noticed that apparmor logs (or any audit logs) were not being sent remotely.
After reviewing the local system, journald DOES ...
3
votes
2
answers
673
views
`journald` vs `systemd-journald` - are they the same notions?
I am new to systemd.
I have read that along with systemd boot system comes it's own logging daemon - journald. But there is also a lot of mention of systemd-journald daemon over the Internet.
At first ...
-1
votes
1
answer
2k
views
How to use journalctl with custom log file
I would like to make a backup of journal log files from a different machine and analyze them locally (while the other machine will get reformatted).
How can I:
Create a full backup of journal logs ...
0
votes
1
answer
715
views
Can I mount `/var/log/journal` as `tmpfs`?
I have read this question, but it discusses syslog and my question is about journald. Can I mount /var/log/journal as tmpfs using fstab, or will journald be run (and therefore maybe write to the ...
0
votes
1
answer
849
views
Why all Xorg log messages are written to journal at level 4 (warning)?
All the content of Xorg.n.log can be viewed with journalctl. As Xorg is launched by GDM (if I understand it correctly), it always has the --identifier=/usr/libexec/gdm-x-session. But despite this hint ...
0
votes
1
answer
710
views
How to filter journalctl logs by human readable facility?
I can do the following to get local3 logs:
journalctl SYSLOG_FACILITY=19
The magic number 19 is uterly confusing. How can I do the following:
journalctl WHAT_TO_PUT_HERE=local3
?
I do not see ...
1
vote
1
answer
649
views
rtkit daemon: setting logging for systemd service
My journal is littered with instances of
rtkit-daemon[1407]: Supervising 8 threads of 5 processes of 1 users1
I see this excellent post from @MC68020
Stop rtkit-daemon from spamming logs with "...
1
vote
2
answers
1k
views
Why all output of my C program directed to stdout is sent to journald?
I work on yocto based linux distribution. I'm no expert on systemd and neither on systemd-journald.
My C program my_c_program is started at boot by the script my_script.sh. Below there is the file ...
0
votes
0
answers
538
views
Why is /fd/1 (stdout) a socket?
I'm running a game server as a systemd service, and in the .service file, I see that StandardOutput defaults to journal.
Ihsan@IhsanServerVM:/proc/28617/fd$ file 1
1: symbolic link to socket:[510374]
...
2
votes
2
answers
7k
views
systemd-journal-flush.service Failed with result timeout - Failed to start Flush Journal to Persistent Storage
I see this on my systemctl log, the systemd-journal-flush.service fails to start with a timeout error. Server is apparently running fine though. OS is CentOS 8. Logs don't tell much about the error. ...
4
votes
2
answers
1k
views
What are the .journal files that have a ~ on the end?
I have some files in my /var/log/journal/f7e928ba68a9449e85bd828252981fc6/ that have a .journal~ extension.
Can I remove these?
example:
-rw-r-----+ 1 root systemd-journal 16777216 Dec 21 08:46 ...
2
votes
1
answer
770
views
Log particular systemd service logs only to syslog bypasing journald
For a while looking for a solution that with systemd tools will give me an opportunity to bypass the journal and log directly to syslog. Potentially that can be also filtered, but only on journal not ...
0
votes
1
answer
269
views
Why is a gap between `journalctl -k -b -0` and `ps ho lstart 1`?
I encounter a strange observation:
If I do: journalctl -k -b -0 | sed -e 's/^\(.\{76\}\).*/\1.../;3q'
I will see something like:
-- Journal begins at Sun 2022-08-07 12:06:55 CEST, ends at Mon 2023-02-...
2
votes
3
answers
2k
views
How is syslog entangled with journald?
I set up my journald to limit the log size to 5GB in /etc/systemd/journald.conf
and thought everything was fine. Then, yesterday, I realized that my /var/log/syslog file is in fact 12GB big.
What I ...
0
votes
1
answer
685
views
Do kernel messages go through syslogd or journald?
I'm using Debian. Debian ships with rsyslogd for its syslogd. It also ships journald. Does the kernel log to rsyslogd first, or journald?
I want to filter one of the messages out of the logs which is ...
1
vote
1
answer
114
views
What does it mean to say journald collects logs in an "unfakeable way"?
It is said in the systemd-journald.service man page:
The daemon will implicitly collect numerous metadata fields for each log messages in a secure and unfakeable way. See systemd.journal-fields(7) ...
1
vote
2
answers
1k
views
Systemd `journalctl` - Unable to change default $PAGER
I'm on Arch Linux.
I came across some new pager software called OV and installed it. It has more features than less and I like it so I want to set it as my default pager.
I added the following to my ....
5
votes
2
answers
9k
views
How to setup syslog forwarding for systemd journal namespace
I have a configuration /etc/systemd/[email protected] which contains the setting ForwardToSyslog=yes and a systemd service unit configured with LogNamespace=my-namespace.
The documentation ...
1
vote
0
answers
1k
views
systemd-journal-remote claims that the logfile is corrupt
I am trying to upload my journald logs from a server to a centralized server. I am using systemd-journal-remote and systemd-journal-upload for this.
The initial sync of existing logs goes perfectly. ...
3
votes
2
answers
3k
views
Run systemd service only if script condion is True
I have a systemd service that writes to a LCD screen as below;
[Unit]
Description=LCD Screen
[Service]
Type=simple
User=admin
WorkingDirectory=/lcd
ExecStart=sudo /run_lcd.py
StandardOutput=syslog
...
0
votes
0
answers
2k
views
Systemd service does not print output to console/syslog/journal
UPDATED: SEE BOTTOM
I have created a systemd service on debian Linux with systemd version 241 whose purpose is to start up a compiled accelMonitor.c that connects to a kernel module. This kernel ...
3
votes
1
answer
550
views
How does journald get the very starting up message from kernel?
I believe systemd-journald starts logging after the kernel starts up and need some time to set systems up like storage and network services.
But journal log has the kernel messages like dmesg has even ...
0
votes
1
answer
899
views
How to prevent journald from writing to console?
When I check my Centos Stream 9 console, I see messages written by journald to the console even before logging in. Above are some example messages.
How can I prevent journald from witing ANY message ...
5
votes
0
answers
13k
views
systemd-journal is using 100% cpu
This is the result of top command
I caught it at 99.7% but It even uses 170%. this is the output of journalctl
I thought it is something related to Bluetooth, so I turned it off but still got the ...