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
17
votes
7 answers

start request repeated too quickly

I'm writing a bash-script but I often face this issue. When I try to start or stop a service I often get: start request repeated too quickly How can I solve this problem? It's for example when I try to restart docker or openshift-origin…
lova
  • 679
  • 4
  • 8
  • 19
17
votes
2 answers

systemd user journals not being created

Several identical machines all running Fedora 21 in a cluster are all exhibiting identical issues: Attempting to pull a user journal with journalctl -r gives: No journal files were opened due to insufficient permissions. Trying journalctl --user -r…
Winston Messer
  • 187
  • 1
  • 1
  • 5
17
votes
3 answers

Start Docker container using systemd socket activation?

Can an individual Docker container, for example a web server, that exposes (listens on) a port be started using systemd's socket activation feature? The idea is to save resources by starting a container only when it is actually needed for the first…
Markus Miller
  • 3,695
  • 2
  • 29
  • 33
17
votes
1 answer

Startup script with systemd in Linux

Can I do This start up service below, there are no errors showing once run, but the server script below does not run! ln /lib/systemd/aquarium.service aquarium.service systemctl daemon-reload systemctl enable aquarium.service systemctl start…
Ossama
  • 2,401
  • 7
  • 46
  • 83
16
votes
2 answers

Launch docker automatically when starting ec2 server

Everytime I restart my ec2 server I have to do: sudo systemctl start docker and then docker-compose up -d to launch all my containers. Would there be a way to automatically run these two commands at the start of the instance? I have read this answer…
16
votes
2 answers

How to get actual path to executable when using .netcore 3.0 and using the /p:PublishSingleFile=true flag?

I recently upgraded an application to dotnet core 3 and started using the PublishSingleFile flag during the build process. With these two changes the way the executable path is found has changed. Now instead of getting the path where the executable…
BillHaggerty
  • 6,157
  • 10
  • 35
  • 68
16
votes
2 answers

Trying to run apache airflow on ubuntu server with systemd

I'm trying to run airflow on an ubuntu server with systemd. I have followed quick start guide and the tutorial from the airflow documentation and I have managed to install airflow and successfully run it by using the command: airflow webserver -p…
Mr. President
  • 1,489
  • 3
  • 11
  • 21
16
votes
7 answers

How can I use spaces in systemd command line arguments?

I have a systemd unit with spaces in an argument ExecStart=command --argument="text text" It seems that systemd does not recognize the double or single quotes and it splits up the argument into two arguments. Any idea how I can prevent that? I am…
Wolfgang
  • 1,408
  • 2
  • 15
  • 20
16
votes
2 answers

Nginx log to stderr

I want to redirect nginx access logs to stdout to be able to analyze them through journalctl (systemd). There is the same question with approved answer. Have nginx access_log and error_log log to STDOUT and STDERR of master process But it does not…
Ivan Kleshnin
  • 1,667
  • 2
  • 21
  • 24
16
votes
2 answers

How to get the process id of command executed in bash script?

I have a script i want to run 2 programs at the same time, One is a c program and the other is cpulimit, I want to start the C program in the background first with "&" and then get the PID of the C program and hand it to cpulimit which will also run…
Skilo Skilo
  • 526
  • 4
  • 11
  • 23
16
votes
2 answers

Problems trying to enable/start custom target in systemd

i create a target file to group all my personal services in my fedora 18, i tested the services and i can start then individually, but if i try to enable the target i got a error message! [root@ghostrider system]# systemctl enable…
LottaLava
  • 889
  • 1
  • 9
  • 21
15
votes
3 answers

Using variable in command path for ExecStart in systemd service

Im trying to make a systemd service like below : [Unit] Description=Syslog [Service] Type=simple Environment="TESTEXTSERVICESFILES=/opt/test/extservices" Environment="TESTCONFDATA=/storage/test/conf" ExecStartPre=/bin/echo…
Mistrale
  • 153
  • 1
  • 1
  • 5
15
votes
3 answers

What is systemd PID file?

I want to run jar file as a daemon. So I have written a shell script to "start|stop|restart" the daemon. I didn't get a chance to its working status. Can I use this script without creating a PID file? Why do we need a PID file at all? In which case…
Sekhar
  • 499
  • 2
  • 6
  • 15
15
votes
2 answers

Configure Prometheus to use non-default port

I would like to install Prometheus on port 8080 instead of 9090 (its normal default). To this end I have edited /etc/systemd/system/prometheus.service to contain this line: ExecStart=/usr/local/bin/prometheus \ --config.file=/etc/prometheus.yaml…
rookie09
  • 736
  • 1
  • 6
  • 18
15
votes
4 answers

Systemd: Start operation timed out. Terminating

I'm trying to create an autostart service for my python-flask-socketio server. I need to start a python script through systemd. Here's my service code: [Unit] Description=AppName [Service] Type=forking ExecStart=/usr/bin/python3…
Nix
  • 465
  • 1
  • 7
  • 16