Questions tagged [systemd]

Systemd is a system management daemon designed for Linux. Use this tag for *programming questions* using systemd or its libraries. Questions about *configuring the daemon* (including writing unit files) are better directed to Unix & Linux: https://unix.stackexchange.com.

Systemd is a system management daemon designed for Linux and programmed exclusively for the Linux API. For systems using it, it is the first process which is executed in user space during the Linux startup process. Therefore, systemd serves as the root of the user space's process tree.

2384 questions
281
votes
10 answers

How to redirect output of systemd service to a file

I am trying to redirect output of a systemd service to a file but it doesn't seem to work: [Unit] Description=customprocess After=network.target [Service] Type=forking ExecStart=/usr/local/bin/binary1 agent -config-dir…
meallhour
  • 13,921
  • 21
  • 60
  • 117
253
votes
17 answers

Elasticsearch: Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

I have an issue with a systemd config for ElasticSearch. [Unit] Description=platform-elasticsearch After=syslog.target network.target remote-fs.target nss-lookup.target [Service] User={{ app_user }} Group={{ app_group…
casibbald
  • 2,805
  • 2
  • 16
  • 14
178
votes
32 answers

nginx.service failed because the control process exited

nginx.service failed because the control process exited $ systemctl status nginx.service nginx.service - Startup script for nginx service Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: failed…
daliborsb
  • 1,781
  • 2
  • 10
  • 4
153
votes
9 answers

How can I use iptables on centos 7?

I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for httpd service, but something wrong with my iptables service ... what's wrong with it? What am I doing wrong? # ifconfig/sbin/service iptables…
Meiblorn
  • 2,522
  • 2
  • 18
  • 23
121
votes
7 answers

How to ensure that there is a delay before a service is started in systemd?

I am having a service that depends on Cassandra coming up gracefully and the cluster being up and ready. To ensure that the dependency order is met, I have the following unit file…
Sirish Renukumar
  • 1,509
  • 2
  • 13
  • 16
118
votes
7 answers

How can I configure a systemd service to restart periodically?

I have a simple systemd service that needs to be periodically restarted to keep its process from bugging out. Is there a configuration option for systemd services to periodically restart them? All of the Restart* options seem to pertain to…
wes
  • 7,795
  • 6
  • 31
  • 41
112
votes
2 answers

Start systemd service after specific service?

I have a general question. How does one start a systemd unit *.service after a particular *.service has started successfully? More specific question is, how do I start website.service only after mongodb.service has started? In other words…
user2312578
105
votes
2 answers

How does the systemd stop command actually work?

I am using a systemd service which calls a process when it's been "started" (e.g. systemctl start test.service). As per the design, the process stays in a loop forever, we are able to see process existence using the ps command. We have also seen…
user3805417
  • 1,051
  • 2
  • 7
  • 4
96
votes
2 answers

Systemd with multiple execStart

Is it possible to create service with the same script started with different input parameters? Example: [Unit] Description=script description [Service] Type=simple ExecStart=/script.py parameters1 ExecStart=/script.py…
Riccardo
  • 1,011
  • 1
  • 8
  • 7
92
votes
1 answer

Not able to use systemd on ubuntu docker container

Problem It seems systemd is not active or available in Ubuntu Docker containers. Setup I'm running Docker containers from the ubuntu:16.04 and ubuntu:16.10 images. Tests If I execute: systemctl status ssh in the 16,04 container the result is the…
Duncan Gravill
  • 4,552
  • 7
  • 34
  • 51
88
votes
8 answers

Fixing a systemd service 203/EXEC failure (no such file or directory)

I'm trying to set up a simple systemd timer to run a bash script every day at midnight. systemctl --user status backup.service fails and logs the following: backup.service: Failed at step EXEC spawning /home/user/.scripts/backup.sh: No such file or…
dwrz
  • 2,991
  • 2
  • 10
  • 14
84
votes
2 answers

What is the difference between systemd's 'oneshot' and 'simple' service types?

What is the difference between systemd service Type oneshot and simple? This link states to use simple instead of oneshot for timers. I am not able to understand it correctly.
Dinesh P.R.
  • 6,936
  • 6
  • 35
  • 44
83
votes
5 answers

Python daemon and systemd service

I have a simple Python script working as a daemon. I am trying to create systemd script to be able to start this script during startup. Current systemd…
pawelbial
  • 997
  • 1
  • 10
  • 15
75
votes
9 answers

Docker System has not been booted with systemd as init system

I have an Ubuntu 18.04 image runing on my docker container. I login into it and installed Openresty. also installed systemd. When I use command systemctl I get this error: System has not been booted with systemd as init system (PID 1). Can't…
Abdol Seed
  • 1,227
  • 1
  • 14
  • 23
71
votes
1 answer

journalctl - remove logs of a specific unit

With journalctl, it is possible to remove the old logs, by specifying either the maximum disk space they can use, or the maximum age they can have, or the maximum number of separate journal files (using the options --vacuum-size, --vacuum-time or…
audeoudh
  • 1,279
  • 1
  • 8
  • 23
1
2 3
99 100