Questions tagged as ['systemd']
OS: CentOS 7
I am trying to figure out how audit (kaudit
) events are logged in /var/log/messages
.
I have enabled audit=1
in grub which means when the server boots, kernel auditing is enabled. This is the desired state for the particular system and disabling audit is out of the equation. My audit
configuration is as follows
# auditctl -s
enabled 1
failure 1
pid 0
rate_limit 0
backlog_limit 64
lost 74 ...

Calling journalctl --setup-keys
creates a new key pair for Forward Secure Sealing (FSS). How can I check if this was done on a system without generating those keys if it has not happened yet?
Alternatively, since this process creates the key in file fss
in the journal directory, how can I find this directory, since it contains some "arbitrary" hash, e.g. /var/log/journal/3c726bc3b46e1333bb57fa1857efcf35
I want to know the correct way to modify a timer.
It happened to me that I have timer X configured to run at 8 PM daily, modified the job to run at 1 AM, also daily. When executed the daemon-reload the service that it points to was executed even the timer doesn't shows that it was triggered.
Is there a possibility that when reloading the timer the service got executed by default?

How to stop this annoying message?
Nov 23 08:44:48 hostname systemd[1]: Started Poll for Ubuntu Pro licenses (Only enabled on GCP LTS non-pro).
Nov 23 08:47:48 hostname systemd[1]: Starting Poll for Ubuntu Pro licenses (Only enabled on GCP LTS non-pro)..
On Ubuntu 18.04.6 LTS
systemd current version is: systemd-237-3ubuntu10.52
I try to run a btrbk server within a systemd container. Unfortunately, I cannot get btrbk running since the command btrfs subvolume list /srv/backup
fails to run from within the container with "Operation not permitted".
I already tried adding "user_subvol_rm_allowed" to the mount options, as suggested in a lxc issue, however without luck. While btrfs subvolume delete /srv/backup/foobar
works now, I still ...

I ran into an issue with vncserver needing to wait for my autofs-managed home directory. I have multiple users that will need VNC access. The vnc server is started by systemd.
I'm aware that I could do:
systemd edit vncserver@:1.service
systemd edit vncserver@:2.service
systemd edit vncserver@:3.service
etc and add:
[Unit]
After=autofs.service
to each, but I'd rather not be repeating myself when they a ...

I have a systemd bob.target as follows:
Requires=bob@0.service bob@1.service, bob@2.service
I want to set a two-cpu CPUAffinity for each of the bob@ services as follows:
CPUAffinity=0,4 # bob@0
CPUAffinity=1,5 # bob@1
CPUAffinity=2,6 # bob@2
My ideal goal would be to set two CPUS as follows:
CPUAffinity=%i %i+1
When I try the following to dynamically set one of the CPUS I get a parse error:
CPUAffinity ...

Issue description:
On bootup we trigger the service initialization script that is shown below. The script is a part of Instance User Data
.
This script copies the necessary service/timer things to systemd
folder and starts a timer.
From time to time after reboot our timers are not working and stays in N/A
.
The sudo systemctl restart cleanup.timer
command does not help.
Only sudo systemctl stop cleanup.ti ...

Is it possible to reload changes in /etc/systemd/network/*
in a live system?
already tried systemctl daemon-reload
, systemctl restart systemd-networkd.service
, networkctl
... nothing seems to avoid a full reboot.

one common paradigm on all other syslog implementations (rsyslog, syslog-ng, readlog, etc) is to exchange log entries via UDP514 in plain text format.
How do I enable systemd-journal-remote to receive logs in such format?
(I know there are plugins to more complex log providers to emulate the new https format used by default by systemd-journal-remote, but i'm dealing with dumb appliances that can onl ...
Is it possible to compile only systemd-resolved from the large systemd sources (without all the rest of systemd) to attempt identify a fix to backport? Can a new systemd-resolved coexist with the rest of a system that is based on an oldish systemd?
The first time I set up my systemd service, it works fine.
However, when I restart the server, the systemd service doesn't start, but it remains on activating
.
Could someone give any tip of why this is happening?
Unit file:
[Unit]
Description=My App
After=network.service
StopWhenUnneeded=yes
[Service]
Type=notify
NotifyAccess=all
User=ubuntu
Group=ubuntu
WorkingDirectory=/opt/app
KillMode=process
PIDFi ...
I found there is a program that killed my Apache regularly, according to the log information, I understand there is a program using "/etc/init.d/apache2 stop" to stop apache, since this process is gone, how can I find out this PID belongs to which program?
journalctl -o verbose _PID=16630
-- Logs begin at Thu 2021-10-28 ...
[s=b8b9ba8c0b3a434ab134b8e39ad9a421;...]
SYSLOG_FACILITY=3
PRI ...
I currently have a systemd file called golang@.service that is used for all of my go services.
[Install]
WantedBy=multi-user.target
[Service]
EnvironmentFile=/etc/sysconfig/golang_shared_environment
EnvironmentFile=-/etc/sysconfig/golang_%i
ExecStart=/bin/sh -c /local/%i/%i
Restart=on-failure
RestartSec=2
SyslogIdentifier=golang_%i
User=go_%i
[Unit]
After=network-online.target consul.service
Desc ...
I have written a simple service that calls a bash script that should change file permissions at boot time. The issue is that it seems that the service is not working as the permissions are not changed by the time the user logs in.
However, when I run the service manually - sudo systemctl start setpermissions.service
it works and the file permissions are set correctly.
This are the file permission ...
I have a systemd service file my_service@.service
like the following:
[Unit]
Description=...
After=network.target
[Service]
User=...
Group=www-data
WorkingDirectory=/home/...
ExecStart=...
Restart=always
RestartSec=1s
[Install]
WantedBy=multi-user.target
I start then multiple instances like this:
sudo systemctl start my_service@a
sudo systemctl start my_service@b
sudo systemctl start my_service@c

I have a script that I'm running under systemd
which has some debug logs that I'd like to send to both stdout (which should end up in the system journal, viewable with journalctl
) as well as to a log file on my filesystem.
Typically I'd reach for tee
to accomplish this (write to stdout and files), and it works fine when I run the script on its own (I see all my logs on my console as well as in my ...
Within my laptop PC, I set a systemd service that make a OpenVPN connection to my home, and let it automatically start on boot, so that I can access my home server anywhere.
The trouble is that when I'm home already, it still connects to VPN, and confuse the route table of the laptop, therefore I can't access the server when I'm at home.
Is there a way, I can let a systemd service start conditionall ...

Here is an /etc/fstab
record example of one of the mounts as per x-systemd.automount
and other goodies:
UUID=XXXX-XXXX /media/XXXX-XXXX auto noauto,nofail,nouser,uid=root,gid=users,umask=007,X-mount.mkdir,x-systemd.automount,x-systemd.device-timeout=1,x-systemd.idle-timeout=60 0 2
Currently this external exFAT-formatted drive is physically disconnected from the PC, but I still get the following ...
I'm using Fedora CoreOS with the automatic updater enabled, which is great for my use case. Already, when logged in interactively, the system warns about an imminent shutdown/restart via the console, with the same mechanisms described in the answers like Sending shutdown messages to all clients from server
However, the "actual" users of this server aren't Linux users with SSH access but access s ...
I have a couple of services (static site generators) that I want to trigger on a regular basis from the same systemd timer. I found this question/answer, which covers exactly what I want to do, and describes a setup whereby a .target
file that Wants=
multiple services is triggered by a corresponding timer. This sounds great, but I'm finding that when I actually set this up, it only ever triggers

Is there an Upstart equivalent to systemd's RemainAfterExit?
I have an upstart task that exec's a script that completes quickly when the task is started. However, I would still like that task to report as active so that I can subsequently 'stop' the task and have it execute a cleanup script.
In systemd, I would do the following:
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/my_scri ...

I'd like to limit the number of times my service can restart, ever. There are burst limits
StartLimitIntervalSec=60
StartLimitBurst=5
But they limit how many times a service can restart within the specified interval. Is there any way to specify how many times can a service restart in general? As if the interval was set to infinity.
systemd 245 (245.4-4ubuntu3.2)

I'm running systemd
version:
systemd 245 (245.4-4ubuntu3.2)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
on 5.8.0-54-lowlatency #61~20.04.3
For some reason my services started spamming the system log with these messages:
Oct 02 19:46:08 avionics-fchil2-sim.int.archer.com ...
I have a systemd unit file. It starts a php script. There was a network blip, which made me have to reboot after nothing else worked. I noticed that the script was no longer writing to the specified log file, until I manually forced rotation.
[Unit]
Description=Custom Service
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/usr/bin/php -f /path/to/php/script.php
ExecSto ...
On a CentOS 7 server,I'm creating a new systemd service from scratch for a new service, prometheus-slurm-exporter. (It's an application that exports data from the SLURM scheduler on an HPC cluster.) By default it uses Port 8080, but since that port is already in use by another service, I've set it use Port 9090 instead. Run from the command line, the command looks like this:
/opt/prometheus-slurm-e ...
I would like to implement my own process into a CentOS7 operating system which automount an external storage (AVID ISIS for this example) at boot through systemd.
To do that, I scripted the mount procedure (because I cannot use fstab in this particular case, the avidfos command provided by AVID is needed) but I have noticed that my process failed at boot. When I run it just after the boot process ...
I am trying to create a service with systemd, where I use python3 to create a simple socket and leave it as a daemon, but I have made several attempts but in both cases without any success. For today systemd has beaten me, but tomorrow is another day to try.
Server
import socket
host = '127.0.0.1'
port = 9999
BUFFER_SIZE = 1024
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as socket_tc ...

There are multiple reasons to have to rename a systemd service in production. For example:
- to better differentiate it from a new one
- because your boss ordered it
- because of legacy scripts
- ...
Assuming a new generic service created in /etc/systemd/system/foo.service
and enabled and started as follow: [1]
systemctl daemon-reload
systemctl enable --now foo
Then, you may want to rename it from foo.serv ...
I have been breaking my head over this the last few hours. On one of my machines the intel-rapl-msr
driver is buggy and reloading it fixes the issue. I thought I could trivially create a service that does this on boot. But I can't get the service to load after the driver has loaded.
[Unit]
Description=Reload intel-rapl-msr
Requires=systemd-modules-load.target
WantedBy=multi-user.target
ExecStart=/nix/sto ...