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
15
votes
2 answers

systemd `systemctl stop` aggressively kills subprocesses

I've a daemon-like process that starts two subprocesses (and one of the subprocesses starts ~10 others). When I systemctl stop my process the child subprocesses appear to be 'aggressively' killed by systemctl - which doesn't give my process a…
GoZoner
  • 67,920
  • 20
  • 95
  • 145
15
votes
2 answers

How to get systemd to restart Rails App with Puma

I've been struggling with this a week now and really can't seem to find an answer. I've deployed my Rails App with Capistrano. I use Puma as a server. When I deploy, everything works ok. The problem is to get Puma to start at reboot and/or when it…
WagnerMatosUK
  • 4,309
  • 7
  • 56
  • 95
15
votes
1 answer

Why is systemd stopping service immediately after it is started?

I created a systemd service which should invoke a shell script, when started or on reboot. [Unit] Description=Starts the DCCA index software [Install] WantedBy=multi-user.target [Service] ExecStart=/opt/insiteone/bin/indexControl…
RajSanpui
  • 11,556
  • 32
  • 79
  • 146
15
votes
2 answers

Setting DNS for Docker daemon on OS with systemd

The default DNS for Docker (e.g. 8.8.8.8) is blocked where I work, so I want to change the default. I've been able to do this using $ docker daemon --dns but I want to do this using a systemd drop-in instead, since the official…
labyrinth
  • 13,397
  • 7
  • 35
  • 44
15
votes
1 answer

Systemd Service for jar file gets "operation timed out" error after few minues or stay in "activating mode"

the service unit is: [Unit] Description=test After=syslog.target After=network.target [Service] Type=forking ExecStart=/bin/java -jar /home/ec2-user/test.jar TimeoutSec=300 [Install] WantedBy=multi-user.target it starts fine for 1-4 minues. But…
user3674227
  • 151
  • 1
  • 1
  • 6
14
votes
1 answer

unit falling into a failed state (status=143) when stopping service

here is my problem. I have CentOS and java process running on it. Java process is operated by the start/stop script. It creates a .pid file of java instance too. My unit file is looking like: [Unit] After=syslog.target…
sergei
  • 402
  • 1
  • 5
  • 14
14
votes
1 answer

Starting Docker-Engine on boot

When I restart my host, I want my docker engine to start on boot. Is this possible? Can anyone point me in right direction ? My OS is RHEL 7.3 and my /usr/lib/systemd/system/docker.service fiel looks like: [Unit] Description=Docker Application…
Akki
  • 2,179
  • 8
  • 21
  • 37
14
votes
2 answers

Ubuntu 16.04 systemd redis issues with ulimit

I have been having issues with our new redis server after swapping from Ubuntu 14.04 to 16.04. The configuration of the open files limit using all the guides says to change the /etc/security/limits.conf with the following settings * soft nofile…
Ollie
  • 1,140
  • 8
  • 26
14
votes
2 answers

Linux: Start daemon on connected USB-serial dongle

On my Linux (Angstrom distro on BeagleBone Black) I have a USB dongle which presents as a serial port and per default is available as /dev/ttyUSB0 I want to start a daemon, which will connect to the serial port and make it available as a socket. I…
Philipp
  • 4,659
  • 9
  • 48
  • 69
13
votes
2 answers

How to pass environment variables to a service started by systemd

I have a nodeJS service built using NodeJs. This service requires some environment variables to be passed to it. Moreover, I created a systemd unit file to start it from systemctl. For some weird reasons, the service, when started with systemctl,…
Nicolas El Khoury
  • 5,867
  • 4
  • 18
  • 28
13
votes
1 answer

systemd service startup issue

This is the first time I've used systemd and a bit unsure about something. I've got a service that I've set up (for geoserver running under…
vickirk
  • 3,979
  • 2
  • 22
  • 37
12
votes
1 answer

systemd service file Failed to execute command: Permission denied

I am creating the systemd service file on a DigitalOcean Server which has has ubuntu 18 and NGINX as a web server. The script at systemd service file is: [Unit] Description=gunicorn…
mrc
  • 2,845
  • 8
  • 39
  • 73
12
votes
1 answer

Executable path is not absolute, ignoring: $(which node)

The idea is to use a variable pointing to node instead of hardcoded path, my solution was this ExecStart="$(which node)" /home/jonma/Development/chewy But when I run the service I get the following error: feb 08 11:12:51 jonma-VirtualBox systemd[1]:…
JonB
  • 804
  • 3
  • 12
  • 40
12
votes
1 answer

Creating filename_$(date %Y-%m-%d) from systemd bash inline script

I am trying to execute a systemd timer and would like to keep the output from the executed script in a file per date. Here is my ExecStart script in the .service file: ExecStart=/bin/bash -c 'echo $(date +%Y-%m-%d) >>…
bobbytables
  • 303
  • 1
  • 2
  • 7
12
votes
5 answers

Running Python script via systemd fails to load module

I have a Python script that uses zmq and I've installed this library via pip install zmq and I can run the program fine if called manually via the command line. However as soon as I attempt to have a systemd unit call the script, running systemctl…
Shiri
  • 1,972
  • 7
  • 24
  • 46