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

systemctl eternal activation, can't active

it works perfectly from project folder throught "dotnet run" and after release build too (./appname). But I need to demonize it, but my service activates endlessly. tgbot.service: [Unit] Description=MYTGBOT…
UNRE
  • 47
  • 8
0
votes
0 answers

Problems with using systemd to run Flask app with Gunicorn in Docker

I have been having the ModuleNotFoundError: No module named error when I try to use systemd to run Gunicorn in Docker when the machine starts. I have verified that I can run Gunicorn in Docker with the same command plus the -it flag with no issues,…
honeypizza
  • 1
  • 1
  • 2
0
votes
0 answers

systemd reading variables from file

Problem: My systemd service is not passing flags correctly to golang binary. I have the following setup: Script 1. Extract values from a local file and export variables into a file. if [[ -n "${AGENT_ENV_FILE}" ]]; then ENV_FILE_CONTENT=$(cat…
gogasca
  • 9,283
  • 6
  • 80
  • 125
0
votes
1 answer

ssmtp called from a script fails with ssmtp: Cannot open mailhub:25 but script is running with user in mail group

I am trying to get motion to run a script on the on_movie_end event. The script, below, calls ssmtp to send the file as an attachment. If I call the file from the command line, as the normal user, or using sudo -u, the script runs fine, with no…
miller the gorilla
  • 860
  • 1
  • 7
  • 19
0
votes
0 answers

Using mailx in a bash script running under systemd

I am trying to get a bash script that sends email with attachment to be executed by systemd. Running the script from the command line works fine, but when systemd runs it, the mailx command does not send the email. # email report /usr/bin/mailx -a…
John W
  • 42
  • 1
  • 9
0
votes
0 answers

systemd doesn't execute bash lines with ampersand

i am working on a start up script which will read "command lines" from a file and take 'em into an array. then using for loop to execute one by one from the array. every thing looks perfect when the script is run. However after calling the script…
KrisJ
  • 1
  • 2
0
votes
0 answers

Service RestartSec=100ms expired, scheduling restart - systemd service restarts every10 seconds, not intended

System: Red Hat Enterprise Linux release 8.7 (Ootpa) I have created a systemd service: # systemd service definition file [Unit] Description=RTDE UR Plugin After=docker.service Requires=docker.service [Service] # "-" path prefix makes systemd record…
0
votes
1 answer

How to setup wordpress as linux systemd service

I have multiple wordpress sites hosted on Ubuntu 22.04 which are configured through php8.1 fpm and nginx sites-available. The problem I'm facing is that I can't stop an wordpress site like a systemd service. I've previously setup django python based…
0
votes
1 answer

running python script over sysmd unit: time.sleep of more than 60 seconds does not work

I am running a systemd unit python script at my RaspberryPi to send temperature data automatically when the Pi has power. When time.sleep is at 60 seconds everything works fine. But when time.sleep is longer (120 seconds or more), it only sends one…
leolumpy
  • 63
  • 6
0
votes
0 answers

How to print a python print() to linux terminal out of a systemd service?

With this code i try to print things to the linux console of my raspberry pi print("test1") sys.stdout.write("test2") sys.stdout.flush() This works if i run the python program out of a systemd service. If i put the python program into a shell…
cheat.008
  • 21
  • 5
0
votes
0 answers

.NET application running on Linux reaches Tasks limit

I have a .NET 6 application hosted on Linux's systemd. Lately I have been having problems with service restarting itself and just noticed that Tasks reaches its limit which is over 10k. Any ideas where could the problem lie? Not sure what…
0
votes
1 answer

How to handle a Docker RUN apt install command that wants to install systemd service

What is the proper way to go about using an Aptitude package that wants to install a systemd service on Linux within a Docker container? Here is the output: krzysztof@pop-devx:~/docker2_edgeiq$ docker compose build [+] Building 3.8s (21/22) …
Kris
  • 363
  • 3
  • 11
0
votes
1 answer

How to set the LANG for a python script running through systemd?

On the server where I run the program the default encoding is latin-1, and when I try to run a python script I get an error like 'latin-1' codec can't encode characters in position, etc. I know you can change the default locale with dpkg-reconfigure…
user18196171
0
votes
1 answer

Getting the exit code of an application launched via startx

I'm setting up Debian so that it works in kiosk mode. To do this, I created a service that performs the watchdog function: [Unit] Description=Watchdog for myapp After=getty@tty7.service After=polkit.service After=udisks2.service…
0
votes
0 answers

Issue creating a Packer debian image with systemd enabled

I am using WSL2 on Windows 10. I have the most v1.0.3 of WSL which allows systemd (systemctl) and am using Ubuntu 20.04 as my default distribution. I have a functioning Dockerfile to build a Debian image with systemd enabled. It works perfectly…
Elsebet
  • 1
  • 2