Questions tagged [systemd]
systemd is a modern replacement for the traditional Linux init. Its main features include the ability to express dependencies between services and aggressive parallelization of service startup.
119
questions
15
votes
2
answers
12k
views
Change systemd unit tag send to journalctl/syslog
Is it possible to change what tag systemd managed service uses for logging? For example, my custom service report-daemon.service defined as
# ...
[Service]
ExecStart=/usr/bin/php # ...
# ...
shows ...
15
votes
1
answer
32k
views
What is SIGRTMIN+24 in syslog?
My Debian 8 vm has lots of systemd logs like this:
Apr 28 23:02:09 foo systemd[22305]: Starting Shutdown.
Apr 28 23:02:09 foo systemd[22305]: Reached target Shutdown.
Apr 28 23:02:09 foo systemd[...
15
votes
2
answers
25k
views
How can systemd run a command as root before launching a service as a different user? [closed]
I'm running svnserve on a Fedora 17 machine with the following systemd service file:
[Unit]
Description=Subversion Server
After=syslog.target network.target
[Service]
User=svn
Type=forking
...
14
votes
2
answers
45k
views
How to configure systemd to kill and restart a daemon on reload?
I have an old-school daemon that I want to control using systemd. When its configuration file changes, it needs to be killed and restarted. In other words, after editing the config file, systemctl ...
14
votes
2
answers
57k
views
Systemd: how to start service after another service started
I have these two services, one is Google start up script service and second one is redis service, I want to start redis service once the startup script service is started and done, I have these ...
13
votes
5
answers
15k
views
Systemd - start service only after DNS is available
I've got a couple services, most notably nginx and ntpd, that depend on having working DNS resolution to start properly. Right now neither of these services start correctly at boot time, but do start ...
12
votes
1
answer
9k
views
How to use systemd-firstboot.service?
I'm making an image of Debian Jessie. On boot the system has no /etc/machine-id file. This causes some problems with the journald that doesn't start.
I've found that in the systemd repo:
# This ...
11
votes
2
answers
13k
views
varnish daemon not listening on configured port
I'm trying to install varnish on ubuntu 16.04,
I read several article none are working.
From what I read, since ubuntu 15.04, the way of configuring varnish has changed (because of systemd).
Now on ...
11
votes
3
answers
6k
views
Why are journald logfiles so huge?
When I do a journalctl --disk-usage it says something about 300MB size of the journal files but when I look at the actual text with journalctl | wc -c it's something about 28MB. Well, journald has ...
11
votes
1
answer
3k
views
Increase disk detection timeout at boot with Linux/Systemd
I have a machine with a lot of disks, and an extra SAS controller in HBA mode.
This seems to cause Linux to think for at least 8-10 seconds once in initramfs before the disks actually appear. The ...
9
votes
2
answers
3k
views
Why does my systemd timer only trigger once when the unit is a target?
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 ...
9
votes
2
answers
16k
views
How do I set cgroup limits for systemd user slices?
I would like to limit usage of a system on a per user basis. Since Systemd has native support for cgroups, I think using user slices is the way to go.
The problem is: I can't figure out how to set ...
9
votes
1
answer
5k
views
View unbuffered log output from journalctl
I have several systemd services defined. They log both to disk and also to the systemd journal, which I can monitor using journalctl -n 0 -fu myservice. However, I notice that the logs that I see ...
9
votes
4
answers
38k
views
How do I know if systemctl daemon-reload needs to be run
Is there a way to know the current running config is outdated? Is there a way to view the current running config and compare it to the file?
It would be valuable for troubleshooting to know what the ...
8
votes
2
answers
9k
views
How do you configure multiple systemd services to use one timer?
I've noticed some significant variation in approach in some systemd documentation and how-to documents concerning how to configure one or more services to use the same timer.
As far as I have been ...
8
votes
2
answers
25k
views
SELinux blocking execution in systemd unit
I use Fedora 31 and tried to set up a Teamspeak server. When I look in journalctl -u teamspeak I get the following error:
mar 09 22:22:46 melchior systemd[1]: Started Teamspeak server.
mar 09 22:22:...
7
votes
0
answers
2k
views
Applying systemd control group resource limits automatically to specific user applications in a gnome-shell session
Having seen that GNOME now launches apps under systemd scopes I've been looking at a way to get systemd to apply some cgroup resource and memory limits to my browser.
I want to apply a MemoryMax and ...
7
votes
1
answer
2k
views
Chaining custom systemd services
I have timer A that every few hours runs a script that runs service B(script with systemctl start in it). Then I would like to run service C after B is finished.
Here is my service C:
[Unit]
...
7
votes
2
answers
3k
views
systemd Vagrant and VirtualBox: wait for synced folder to mount
I'm trying to setup a systemd service on a Vagrant box which requires the Vagrant synced folder to be mounted before starting.
Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "...
5
votes
2
answers
13k
views
How can I get haproxy to log to systemd/journald?
I have a current generation Linux system I'd like to use with haproxy. Journald will happily log stdout from .service, and mark the log as coming from that service, but haproxy doesn't seem to be able ...
5
votes
2
answers
4k
views
Parsable output from systemctl (for example list all units)
I am not happy with the output of systemctl
I have a script which parses the output of
systemctl list-units -t service --full --all
The beginning of the output look like this:
UNIT ...
5
votes
2
answers
10k
views
Prevent a systemd service from starting if another systemd service is running
In systemd (v237 on UbuntuLinux 18.04 bionic), I can create a service file (for A.service), and specify another service Requisite=B.service. Meaning if I try to start A.service and B.service isn't ...
5
votes
1
answer
3k
views
reliable systemd service for autossh
I try to create a reliable systemd service for autossh.
The service works, but if the host-keys changes, the service is in state ok (running).
I want it to be in state "failed" if the tunnel does ...
5
votes
1
answer
14k
views
x11vnc on Ubuntu 16.04 Gnome with systemd
I am having troubles to start x11vnc service on Ubuntu server 16.04 Gnome.
It used to work just fine under 14.04. Not sure if related to x11vnc itself or the systemd.
Here is the systemd service file ...
5
votes
1
answer
10k
views
CentOS 7 disable predictable network interface names during install
I know I can use net.ifnames=0 biosdevname=0, with grub, to disable predictable network interface names. This names the first interface as eth0 instead of enp0s3, or whatever. How do I specify this at ...
4
votes
4
answers
7k
views
Changing the I/O scheduler for a specific disk
I would like to change permanently the I/O scheduler for a specific disk on Fedora 20. According to what I have found, this can be achieved by executing the following shell line as root:
echo {...
4
votes
2
answers
507
views
Start stopped service because of dependency update
I have two systemd services: postgresql.service and app.service. postgresql.service is distribution provided (ubuntu 15.10) and app.service is written by myself.
Since app needs postgresql, the ...
4
votes
2
answers
7k
views
systemd instance name (%i) not working in ExecStart
For some reason, systemd is not replacing %i or %I with the instance name in ExecStart
/systemd/system/service/[email protected]
[Unit]
Description=Foo service for %I
[Service]
User=keith
ExecStart=/...
4
votes
3
answers
3k
views
How does systemd put sshd processes in slices?
I'm diagnosing an SSH bastion I manage. This machine has about 5500 SSH connections with port forwarding at any given point in time.
Recently, I ran into an issue where SSH connections where refused ...
4
votes
3
answers
23k
views
How to configure Systemd service unit to start Node app with "npm start" instead of "app.js"
Environment: CentOS 8, Node.js, Digital Ocean Droplet
My Systemd setup starts a node app with the following command. It works as expected.
$ sudo systemctl start myapp
File 1: /etc/systemd/system/...
4
votes
1
answer
4k
views
Systemd python service buffers journalctl output even with -u
I have a simple user systemd service configured like so:
[Unit]
Description=Bot
AssertPathExists=/home/mikel/discord-bot/
[Service]
WorkingDirectory=/home/mikel/discord-bot/
ExecStart=/home/mikel/...
3
votes
1
answer
5k
views
How to sequence a proper shutdown and startup of web services with systemd?
I am trying to structure the shutdown and startup of Apache, PHP-FPM and MariaDB services using systemd:
These are the additional configuration files in /etc/systemd/system folder:
# httpd.service
....
3
votes
3
answers
14k
views
How to run minikube start as a linux service on startup?
This question is related to How to arrange a non admin command as a systemd service?
I have the following minikube.service file:
[Unit]
Description=Runs minikube on startup
After=vboxautostart-service....
3
votes
1
answer
23k
views
"Failed at step EXEC spawning" even with proper group permissions
I'm setting up permissions for a basic web server, but having some difficulty with starting the server with systemd.
In my job description, I set the user and group to "foo", as follows:
[Service]
...
3
votes
1
answer
4k
views
Start a program with systemd
I'm trying to install the latest version of ProFTPd (1.3.5) onto a CentOS 7 box, and wound up having to configure and install manually. The reason is that EPEL's version of proftpd doesn't include ...
3
votes
1
answer
5k
views
systemd not restarting my process
I have the following service configured:
[Unit]
Description=HB service started
[Service]
Restart=always # or always, on-abort, etc
RestartSec=3
WorkingDirectory=/home/debian/hb/program
ExecStart=/...
3
votes
1
answer
4k
views
systemd-journal in Debian Jessie LXC container eats 100% CPU
After creating fresh LXC based on Debian Jessie, on a Ubuntu 14.04, systemd-journal eats all CPU available.
lxc-create -n jessie -t debian
3
votes
1
answer
2k
views
How does systemd decide if a service is ok or not
This question is related to: reliable systemd service for autossh
I have a service which uses type=simple. Here the systemd docs:
Type=simple (default): systemd considers the service to be started ...
3
votes
2
answers
6k
views
getting logs from systemd unit into flat files and logstash
I'm running an application under systemd within CentOS 7. It logs to stdout and systemd is capturing that into journalctl just fine. I'd like to also:
get a rotated text log file also saved to the ...
2
votes
2
answers
3k
views
How to set unix socket backlog with systemd?
I've got a problem with nginx and a fastcgi backend. I've tried to increase the backlog size but it doesn't appear to be working. What am I doing wrong?
The backend is started via systemd.
OS: 16.04....
2
votes
1
answer
202
views
logrotate fails to run Java postrotate program
Somewhat recent versions of logrotate fail to execute postrotate actions that invoke Java when logrotate is started via systemd. In my logs I see:
logrotate[123]: Error occurred during initialization ...
2
votes
0
answers
959
views
Certbot renew running but not renewing
I've installed certbot on an Ubuntu 16.04 host using the PPA.
I can see that the certbot timer is configured to run and that it's running:
jaraco@punisher:~$ sudo systemctl status certbot
● certbot....
2
votes
1
answer
2k
views
Truncated/missing logs with systemd on Ubuntu 16.04
I am using Ubuntu 16.04 server, have created a basic nodejs script and packaged it in a simple systemd service.
Content of api.service at /lib/systemd/system/api.service:
[Unit]
Description=api
...
2
votes
0
answers
571
views
Automount ATA/SCSI drives with systemd
I am attempting to automatically mount all ATA/SCSI drives on boot using systemd and udev without utilizing /etc/fstab.
This is necessary because filesystems need to be mounted on directories named ...
2
votes
1
answer
531
views
Patterns or templates in systemd scopes?
I'm working with an external service that creates its own systemd scopes like system.slice/someapp.slice/instance-400.scope or user.slice/user-1000.slice/app-1234.scope.
The scope names embed the pid, ...
2
votes
2
answers
11k
views
Install rsync 3.1.1 on systemd
I have CentOS 7 and it comes with Rsync 3.0.9.
I downloaded the 3.1.1 el7 rpm and installed with rpm -Uvh.
Now the daemon refuse to start. I tried to create :
/usr/lib/systemd/system/rsyncd....
2
votes
1
answer
2k
views
systemd process with uncommon CPU usage on Kubernetes cluster
I'm running a single master/node Kubernetes cluster in a CentOS 7 virtual machine, and I realized that the systemd process (as PID 1) is constantly making using of CPU.
[root@ip-10-0-0-66 ~]# ps aux |...
2
votes
1
answer
2k
views
How do I create a python 3 service that uses socket with systemd?
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 ...
1
vote
1
answer
1k
views
Ubuntu 14.04 /tmp/systemd process using 100% CPU
We have a live AWS EC2 instance with Ubuntu 14.04, which I have been handed to maintain. An oddity that I have found is that I have a process of /tmp/systemd using all available CPU:
top - 11:35:20 ...
1
vote
2
answers
1k
views
Always save HAProxy server state before stop
We sometimes disable specific servers in HAProxy (running on RedHat 7, but compiled locally because 1.8 is not available from RedHat) using an admin socket and we want the state to be maintained if ...