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

Reloading vs. restarting uWSGI to activate code changes

After reading the uWSGI's documentation on reloading, my understanding was that, for an app that uses lazy-apps, writing w to uWSGI's master FIFO should trigger a restart of all workers (and hence activate changes in the Python code). However, that…
Florian Brucker
  • 9,621
  • 3
  • 48
  • 81
9
votes
1 answer

what does hyphen before slash in systemctl service file?

I see ExecStop=-/sbin/start-stop-daemon in the nginx.service file, what does -/sbin mean? [Service] Type=forking PIDFile=/run/nginx.pid ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;' ExecStart=/usr/sbin/nginx -g 'daemon on;…
tcpiper
  • 2,456
  • 2
  • 28
  • 41
9
votes
1 answer

How to convert a python script in a local conda env into systemd service in Linux?

I have a daemon Python script in my conda environment which I run it: source activate my_env python my_server.py I would like to convert it to as systemd service, so I created my_server.service…
motam79
  • 3,542
  • 5
  • 34
  • 60
9
votes
0 answers

Systemd $XDG_RUNTIME_DIR not set

When I start systemd as root on my linux mint 18.2 vm it gives me the following error message : Trying to run as user instance, but $XDG_RUNTIME_DIR is not set. I checked the $XDG_RUNTIME_DIR as user and it gave me /run/user/1000, but i am not…
Vrael
  • 91
  • 1
  • 3
9
votes
1 answer

Logind and gdbus: Not getting notifications

I use DBus to communicate with logind to get informations about active sessions, etc. I have created the code using gdbus-codegen. I can get informations by using the call and get methods, but I do not receive notifications (I have a g_main_loop…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
9
votes
1 answer

How Can Python Handle systemctl stop?

I have a Python script that is running as a service. It writes to disk. If a user calls systemctl stop on the service, I would like to handle the command in my own way to reduce the risk of file corruption. How can I catch the systemctl stop…
Ginger
  • 8,320
  • 12
  • 56
  • 99
9
votes
1 answer

Run a bash script before httpd service is started with systemd

I want to run a custom bash script before httpd service is started with systemd. I'm using Centos 7. Any idea? Kind regards.
Javi
  • 121
  • 1
  • 1
  • 2
9
votes
2 answers

How to escape a systemd Specifier to pass to the command in ExecStart

I've written the following systemd service tcpdumpd.service to kick off a persistent tcpdump recording. [Unit] Description=TCPDumpd After=multi-user.target network.target [Service] Type=simple ExecStart=/usr/sbin/tcpdump -pni eth0 -s65535 -G 3600…
Ben Sooter
  • 317
  • 1
  • 3
  • 11
9
votes
1 answer

Is it expected for systemd to start disabled services?

I have two services, A and B, installed by two different packages. Service B depends on service A. Both are disabled and stopped by default. In order to get service B running on each boot, I enable it, then I start it: systemctl enable B systemctl…
Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
9
votes
2 answers

Can't start gunicorn with systemd django

I'm new to systemd. just installed lubuntu16.04. I have the following systemd file: [Unit] Description=gunicorn…
joel goldstick
  • 4,393
  • 6
  • 30
  • 46
9
votes
1 answer

LD_PRELOAD does not loaded on systemd

I am trying to inject a SO into a process that starts using systemd init system (using LD_PRELOAD), but it does not loaded into the new process. I complied a basic SO (unrandom.c): int rand(){ return 42; //the most random number in the…
Or Smolnik
  • 91
  • 1
  • 5
9
votes
1 answer

Set systemd journalctl to ignore process

My journalctl is littered with gnome-session warnings. I've tracked down the issue to Google Chrome, and the warning is relatively harmless. However, it's flooded my journal output, and frankly I won't be able to find what I need if I do need to…
dook
  • 1,213
  • 1
  • 13
  • 30
9
votes
2 answers

systemd/udev dependency failure when auto mounting separate partition during startup

EDIT: This occurs when I am trying to use a separate partition with ANY mount point, not just /var. I am using Buildroot to build an embedded linux system. I am trying to use a separate partition for /var, but this occurs for ANY mount point. My…
schumacher574
  • 1,081
  • 1
  • 14
  • 32
9
votes
1 answer

Is there a way to stop Erlang servers from automatically starting epmd?

Erlang servers will automatically spawn epmd (the Erlang port mapper daemon) if it isn't already running. I would prefer to manage epmd using systemd as a separate service. This is so that if I have multiple Erlang servers running on one host…
jcollie
  • 648
  • 1
  • 5
  • 15
8
votes
0 answers

How to create a self-starting C++ systemd service with CPackDeb?

I'm new to Debian packaging and I believe this is a fairly basic question, but I am embarrassed to say I've struck out on Google. I have a C++ project which builds with CMake and packages a debian with CPack. This project has a service component…
Sean Kelly
  • 338
  • 1
  • 10