Questions tagged [systemd-journald]

journald is part of systemd and responsible for collecting system logs

Filter by
Sorted by
Tagged with
187
votes
9answers
208k views

How to clear journalctl

I couldn't find in google any safe way to clear systemd journal. Do anyone know any safe and reliable way to do so? Let's say I was experimenting with something and my logs got cluttered with various ...
76
votes
2answers
104k views

How do I display log messages from previous boots under CentOS 7?

Executing journalctl under a CentOS 7 system just prints messages generated after the last boot. The command # journalctl --boot=-1 prints Failed to look up boot -1: Cannot assign requested ...
42
votes
2answers
30k views

How to tell journald to re-read its configuration?

My question is simple: how do I tell journald to re-read its configuration file without rebooting? I've made some changes to /etc/systemd/journald.conf and I'd like to see if they are correct and ...
25
votes
5answers
12k views

Receiving Syslog messages with a systemd Arch Linux

I'm feeling like I've overlooked the obvious, but I can't figure out how to get my Arch Linux server, which uses systemd, to receive and log syslog messages from a remote system. I have a Cisco 678 ...
22
votes
1answer
22k views

Howto inspect systemd system.journal from another system

I have arch linux failing on a device. The device doesn't have any screen, it doesn't respond to network. So I take its SD card, insert it in ubuntu desktop, see a fresh system.journal there and... ...
20
votes
2answers
11k views

journalctl --verify reports corruption

I just noticed this verify option for journalctl and decided to give it a go, it's showing corruption, what might cause that? and what if anything should I do about it? should I investigate further? ...
19
votes
1answer
8k views

Is systemd-journald a syslog implementation?

I wonder if systemd-journald is a new implementation of syslog protocol, or rather, it uses syslog implementations, such as rsyslog, syslog-ng I've googled a bit, but I didn't find nothing convincing ...
18
votes
2answers
26k views

Where does `logger` log its messages to in Arch Linux?

The logger command logs an entry via syslog, which usually puts that line to some file like /var/log/messages. If I understand the documentation correctly in Arch Linux all the logging is done ...
16
votes
2answers
12k views

How do I clear journalctl entries for a specific unit only?

I spent a few days writing a python script, and creating a systemd unit file for it. During testing, the script logged a lot of errors to journald. I would like to clear those errors from journald now ...
12
votes
1answer
3k views

How to avoid /usr/bin/env being marked in systemd logs as the executable

I've created a systemd service to run a tomcat application based on the information found in this article. The short version of the article recommends avoiding the shell script wrappers, and executing ...
10
votes
1answer
13k views

How to direct the journal output of certain units to a particular file?

I've got a system with several daemons running (as systemd units) that output log information to the journal in Arch Linux. I want to direct the journal output of some of those unit files into a ...
10
votes
2answers
1k views

How to configure per-unit log storage policy with journald?

I have one particular service, that logs rare, but important information. I've set it up few months ago, and today I've run journalctl -n 50 --unit=my-service only to find there are no entries. I'm ...
9
votes
2answers
9k views

How do I restore `/dev/log` in systemd+rsyslog host?

On RHEL7, systemd-journald takes over many of the responsibilites of what was once done by rsyslogd. Whether by bug or conflict between these two daemons, sometimes /dev/log will go missing. As a ...
9
votes
2answers
4k views

How to determine exactly why Systemd enters emergency mode

My desktop computer running Debian Jessie started dropping into an emergency mode shell on every boot up. The screen says to use journalctl -xb to find the reason, and to use systemctl default to ...
8
votes
3answers
27k views

Tomcat 7 not producing log output to catalina.out on RHEL7

I have a RHEL7 server with Apache Tomcat 7.0 installed and after a recent update to RHEL7.1 all of the logging to ${catalina.base}/logs/catalina.out was stopped. However I am receiving the logs inside ...
8
votes
1answer
4k views

Why is my systemd journal not persistent across reboots?

I'm experiencing a very weird issue with a fresh Fedora 21 image on a Linode instance. I cannot reproduce it outside of Linode. The issue is that my systemd journal is not persistent across reboots. ...
8
votes
3answers
20k views

How do I see when a systemd service was started/stopped/restarted?

I have a service (written by myself) running on a Debian (Jessie) server, and the service's own logs happen to indicate that it restarted at a particular time. There is no indication of a segfault or ...
8
votes
2answers
1k views

Debugging lock-up - systemd loses my logs

Ever since I have "upgraded" to systemd on Arch Linux, I keep losing logs when an unexpected lockup happens. I hit the same log-losing issue one month ago and just hit the issue again. There are also ...
7
votes
4answers
8k views

How to configure fail2ban with systemd journal?

I've install fail2ban on Debian Jessie LXC container, currently it's failing due to: Starting authentication failure monitor: fail2ban ERROR No file(s) found for glob /var/log/auth.log ERROR Failed ...
7
votes
1answer
4k views

How to get access to the root journal for systemd?

When I execute journalctl -f -a under Fedora 20 for different users I get different results. For root I get something similar to tail -f /var/log/syslog on older systems. As normal user I get gnome-...
6
votes
1answer
7k views

Output of a python script running as unit is out of order while shells seems unnafected

How would I get all outputs of systemd managed python2 script instantly into journal, just like it appears in terminal I'm on centos 7, but seems to be same on arch according to systemd manual, ...
6
votes
1answer
2k views

How do I indicate the log level of a line of output from a systemd service?

I have a script that I intend to run as a systemd service. I know that stdout and stderr will be routed to the systemd journal. Is there any way for me to indicate that a line of output be treated as ...
6
votes
2answers
5k views

Rsyslog `logger` message duplicated

I just had a problem with rsyslog's imjournal module, possibly the issue described here, whereby complications with systemd's journal cause the journal to return the same data endlessly in a tight ...
6
votes
1answer
4k views

How to view stderr log only with journalctl?

Please assume there's an app/script which prints a great deal of logging data to stdout. When something bad but expected happens within the script (exception handling), scripts reports an error to ...
5
votes
3answers
13k views

How to get kernel boot log with journalctl?

I have a systemd/journald running on my board. The system was built by means of yocto; systemd version is 216. What I want to get is a kernel boot log, which can be obtained with journalctl -k. But ...
5
votes
2answers
4k views

script can't write to systemd journal

to make it short: I want to write to the systemd journal from a script. printf "%s\n%s\n%s\n" CODE_FILE=/etc/zsh/zprofile CODE_LINE=31 MESSAGE="could not read /etc/dircolors" | logger --journald ...
5
votes
2answers
371 views

How to fix unit attribution of last lines of systemd logging before exit?

I have a systemd service which logs to stdout. From there, systemd captures STDOUT and writes it to the journal. I use a common idiom for handling an error where I echo some diagnostics, then exit ...
5
votes
1answer
4k views

systemd-journal: what is the relation of dev-log and syslog?

I am trying to figure out the relation of the two, /run/systemd/journal/dev-log /run/systemd/journal/syslog which I could not find enough clear documentation. In certain sense, are they basically ...
5
votes
3answers
7k views

How can I get a list of login attempts with journalctl?

According to the systemd docs, journalctl is recommended for browsing logs, rather than the /var/log/* file tree. While man 1 journalctl describes how to use it, I still don't know what arguments it ...
5
votes
2answers
3k views

Examining /dev/log

/dev/log is the default entry for system logging. In the case of a sytemd implementation (this case) it's a symlink to whatever /run/systemd/journal/dev-log. It used to be a receiving end of a unix ...
4
votes
1answer
2k views

Reloading systemd-journald config

Not sure why this is happening. I have a test service logging some arbitrary text to stdout every 10 seconds. Here is my service file /etc/systemd/system/samplego.service: [Unit] Description=Sample ...
4
votes
3answers
3k views

Redirecting stderr and stdout separately to a function in a bash script

I'm working on a wrapper script to log cronjob output to journald. I have several goals: must log stderr and stdout to journald with different priority levels and prefix-tags must also output stderr ...
4
votes
1answer
718 views

journalctl shows very old boots which are not recycled

The system has very old boots (2 and 3 years old), which are not recycled and I haven't been able to vacuum them: $ journalctl --list-boots --no-pager -16 53baf678f0d749d6b390afea4a3ef96b Wed 2014-04-...
4
votes
3answers
16k views

Log every command typed in any shell: output (from logger function to syslog-ng/journald) contains duplicate entries for commands?

I installed syslog-ng to use on my desktop (Gentoo 64bit, upgraded to systemd i.e. was OpenRC before, with Openbox and Slim only) with my normal user to log all commands I type in the shell (bash ...
4
votes
1answer
485 views

journald for systemd user services

I'm running a lot of stuff using systemd's user-level service management. So far it's been great being able to take advantage of timers, conditional services, etc. but one thing that is sorely lacking ...
4
votes
1answer
1k views

How to not log some messages in systemd journal

Using Archlinux aarch64, I have an error message that keeps happening, which apparently cannot be solved, at least not simply (see this question). Since it occurs very frequently I am concerned about ...
4
votes
2answers
386 views

systemd: lie about process name using sh -c exec idiom

I'm using the sh -c exec idiom in an ExecStart statement (in a service unit file) to interpolate some shell commands. For example: ExecStart=/bin/sh -ec "exec /usr/bin/foo $(/usr/bin/foo-config)" It ...
4
votes
1answer
741 views

In journald, why are some sshd log entries not attributed to ssh.service

When using journalctl to inspect my journald logs the output from the commands journalctl -u ssh.service and journalctl _COMM=sshd differ. The first command produces just a subset of the log ...
4
votes
2answers
259 views

systemd DynamicUser= services v.s. journald splits

systemd-journald has the default config SplitMode=uid, to create individual journal (log) files for each user, which they are allowed to read. When running services with DynamicUser=, does this mean ...
4
votes
1answer
176 views

How to prevent a process from writing to the systemd journal?

I am using a third party .NET Core application (a binary distribution used by a VS Code extension) that unfortunately has diagnostic logging enabled with no apparent way to disable it (I did already ...
4
votes
0answers
485 views

Remove single line from journalctl file

I have an Ubuntu 18.04 server that is running a service I'm developing. The output is being sent to the system journal for logging. I accidentally failed to sanitize some logging and a plaintext ...
4
votes
0answers
304 views

systemd stdout logging for long lines

systemd appears to split very long log lines in multiple log messages: $ journalctl -u myunit Nov 12 08:00:18 ovh7 uwsgi[32441]: SHORT LINE Nov 12 08:00:18 ovh7 uwsgi[32441]: START of VERY VERY LONG ...
4
votes
0answers
3k views

Why does journalctl say “— no entries --”?

For example: ┌─[10:50:38/hypership/root/~] └─╼ journalctl -b No journal files were found. -- No entries -- ┌─[10:50:46/hypership/root/~] └─╼ journalctl --verify No journal files were found. /var/...
4
votes
0answers
2k views

Why does my user's login cause systemd to use up a CPU?

Recently I asked this question and this one about systemd and a few related processes using 100% CPU just 5 minutes after every boot. I have a quadcore Intel processor, each core has two virtual ...
3
votes
1answer
527 views

What does “org.gnome.Shell.desktop[1711]: ” mean in the systemd journal?

$ journalctl -b ... Mar 23 18:18:50 alan-laptop pkexec[31408]: pam_unix(polkit-1:session): session opened for user root by (uid=1001) Mar 23 18:19:47 alan-laptop org.gnome.Shell.desktop[1711]: ...
3
votes
1answer
775 views

The simple but correct way to have a bash script send output to systemd journal?

I have simply been sticking something like this at the top of my bash scripts. This still works with systemd. (I have used it for a long time and I don't fully understand it. It just works, so I use ...
3
votes
3answers
4k views

Can I mask the systemd-journal-flush service and run journalctl --flush later manually?

On my archlinux installation, I realised that flushing the journal logs to disk by the systemd-journal-flush service significantly prolongs the boot process and masking the service improves boot time. ...
3
votes
3answers
10k views

How to get see error message in journald

I've created a program that intentionally has an divide by zero error. If I run it in the command line it returns: "Floating point exception" But if I run this as a systemd service I can not see ...
3
votes
1answer
773 views

The Systemd Journald use too much memory and don't respect SystemMaxUse and RuntimeMaxUse?

I found the systemd-journald takes like 1GB+ of memory. After some searching I set the value of SystemMaxUse and RuntimeMaxUse both to 8M in "/etc/systemd/journald.conf". Then restart the journald. ...
3
votes
1answer
991 views

Why journalctl does not display log message if I use filtering by unit?

I'm using Ubuntu 16.04 and I am seeing some strange behavior when analyzing journalctl logs. Here's unfiltered output (I used json output to hopefully include all relevant fields): $ journalctl -o ...