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
12
votes
1 answer

systemd: How to clear an entry when overriding a unit file

A service on my machine has a default unit file that specifies the PIDFile setting in the [Service] section. I want to clear this setting, so that a PID file is not specified for this unit. I've created my override. Systemd sees it, so it works…
dispree
  • 121
  • 1
  • 4
11
votes
1 answer

Execute multiple commands with && in systemd service ExecStart on RedHat 7.9

I have this systemd service on Red Hat Enterprise Linux Server 7.9 (Maipo) [Unit] Description = EUM Server Service PartOf=eum.service # Start this unit after the app.service…
Stefano Lazzaro
  • 387
  • 1
  • 4
  • 22
11
votes
0 answers

How to configure Celery to run as systemd service with a Django application served by Gunicorn?

I followed the official Celery documentation regarding how to configure Celery to work with Django (python 3) and RabbitMQ. I already have a systemd service to start my Django Application using Gunicorn, NGINX is used as a reverse reverse-proxy. Now…
donmelchior
  • 893
  • 3
  • 13
  • 31
11
votes
1 answer

How to make systemd kill or stop respawning the rsyslog daemon

It is great that systemd can keep rsyslog daemon alive even when it dies. But I am crafting a new rsyslog configuration file and need to start this rsyslog daemon in debug mode. Before I debug rsyslogd, I need to stop the production rsyslog daemon,…
John Greene
  • 2,239
  • 3
  • 26
  • 37
11
votes
3 answers

How do I properly redirect stdout/stderr from a systemd service on Raspbian?

I set up a service on Raspbian (Jessie) using systemd to make it start after boot. The daemon config looks like this: [Unit] After=multi-user.target [Service] Type=idle User=root ExecStart=/bin/sh -c "exec /home/pi/sources/mydaemon.py >>…
Eric
  • 2,300
  • 3
  • 22
  • 29
11
votes
2 answers

What is a 'slot' in sd-bus (C language)

There are several APIs in systemd's sd-bus.h file which optionally take a slot argument. Here's some examples: int sd_bus_call_async(sd_bus *bus, sd_bus_slot **slot, sd_bus_message *m, sd_bus_message_handler_t callback, void *userdata, uint64_t…
Benjamin Leinweber
  • 2,774
  • 1
  • 24
  • 41
11
votes
3 answers

Cannot create systemd script for Puma

I created a service script named "puma.service" in /etc/systemd/system/ with the following contents: [Unit] Description=Puma HTTP…
Gowtham
  • 11,853
  • 12
  • 43
  • 64
11
votes
5 answers

systemd, multiline variable in environmentfile , where new line is significant

I'm using systemd on debian jessie to control a service to which I'm feeding environment variables through the EnvironmentFile=/etc/default/myservice file in this file I have a variable which is a public key JWT_PUB_KEY="-----BEGIN FOO BAR…
allan.simon
  • 3,886
  • 6
  • 35
  • 60
11
votes
5 answers

How to launch a process outside a systemd control group

I have a server process (launched from systemd) which can launch an update process. The update process self-daemonizes itself and then (in theory) kills the server with SIGTERM. My problem is that the SIGTERM propagates to the update process and…
11
votes
2 answers

How to set Varnish to run on port 80. Malfunction of DAEMON_OPTS set in /etc/default/varnish

I have installed varnish and fallowed the exact instruction for setting it up, however, it is not working as expected. My /etc/default/varnish setup is: DAEMON_OPTS="-a :80 \ -T localhost:1234 \ -f /etc/varnish/default.vcl…
Lachezar Raychev
  • 2,113
  • 4
  • 24
  • 34
11
votes
2 answers

Start a service in docker container failed,with error: Failed to get D-Bus connection: No connection to service manager

I installed docker image and built a image successfully. When I ssh to the container and run the command service xxx start, an error popped: service nginfra start Redirecting to /bin/systemctl start nginfra.service /sbin/service: line 79:…
baoxinru
  • 111
  • 1
  • 1
  • 3
11
votes
2 answers

sd_notify() from Java

I have a Java service (implemented using Dropwizard) which I'm launching from a user instance of systemd. So far so good. Now I would like to use systemd's notification features to make it aware of the service state (available as a C library…
Andrew Aylett
  • 39,182
  • 5
  • 68
  • 95
11
votes
2 answers

execute commands in a CoreOS cloud-config (e.g. to add swap)

I see that unlike the standard cloud-config file, there is no runcmd option in a CoreOS cloud-config file. Currently, I enable swap on a CoreOS machine by adding the following to my cloud-config: units: - name: swap.service command:…
cboettig
  • 12,377
  • 13
  • 70
  • 113
11
votes
3 answers

Systemd string escaping

If I run this command /bin/bash -c 'while true;do /usr/bin/etcdctl set my-container "{\"host\": \"1\", \"port\": $(/usr/bin/docker port my-container 5000 | cut -d":" -f2)}" --ttl 60;sleep 45;done' I get back from etcd what I expect {"host":"1",…
MParker
  • 315
  • 2
  • 3
  • 10
10
votes
1 answer

What is a drop-in file? What is a drop-in directory? How to edit systemd service

I want to change how a custom systemd service works. systemctl edit serviceName This edits /etc/systemd/system/serviceName.d/override.conf file. Override.conf is called a drop-in file and serviceName.d/ is a drop-in directory. I want to put a…
Paku
  • 455
  • 1
  • 4
  • 15