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

Threads increase abnormally in linux service

I have a service that runs in linux under SystemD but gets compiled and debugged in VS22 under Windows. The service is mainly a proxy to a MariaDB10 database shaped as a BackgroundWorker serving clients via SignalR. If I run it in relase mode on…
0
votes
1 answer

Unable to use Python keyring module from systemd service

I want a python script to automatically start after boot on a linux computer. To achieve this I set up a systemd service: [Unit] Description=My Script…
masterofpuppets
  • 119
  • 2
  • 11
0
votes
0 answers

Detect if dotnet core app on Linux run as systemd

i want to detect if my app (dotnet core 6.0 console) on Linux (Raspibian OS) is running as systemd. Reason is that my app is using OpenCV and it can, if configured, show live video. But if someone forget to set this configuration properly, and app…
Ye Rac
  • 1
  • 1
0
votes
1 answer

python program won't handle systemd KillSignal at reboot

I have a set of LEDs that I start and turn into a specific colour when the machine starts up and during other events. At power-off/reboot I want the LEDs to reset to the default colour. To achieve this I start a systemd service that starts up the…
Madz
  • 1,273
  • 2
  • 18
  • 35
0
votes
0 answers

Linux: Executing 'systemd-analyze' from cpp code

I am trying to automatically collect how long the system took to boot up. The I am working on a cpp code that has been configured as one of the systemd service. I heard systemd-analyze outputs the boot time information. And the command works if I…
TFuji
  • 1
  • 1
0
votes
1 answer

Systemd pass previous run's exit code on restart

Is it possible to get the exit code of a previous run of systemd's process on re-run? That is, suppose I have the following C++ code: int main(int argc, char **argv) { if (argc > 2) { std::string opt = argv[1]; std::string val =…
codingedward
  • 456
  • 5
  • 17
0
votes
0 answers

Running NodeJS as a Service on Linux with Systemd

On server i'm running my project with systemmd service, everything works fine. I just need to send journalctl -u applicationName.service logs to slack. So with slack/webhook library in my code i will send notification to slack. But problem is that i…
0
votes
0 answers

Username as a Unicode/wchar_t string in systemd service?

Consider this typical for Linux function (it returns the current process username): char* currentUserName(void) { struct passwd *p = getpwuid(getuid()); return (p? p->pw_name : NULL); } How to get it in Unicode (let's say wchar_t)? To be…
RandomB
  • 3,367
  • 19
  • 30
0
votes
0 answers

Test a debian package installation

I am writing a test case that tests installation and removal of Debian packages. The debian package had a systemd process in it. During the start up the systemd takes care of starting the service and all the logs are forwarded to systemd. Since the…
BhanuKiran
  • 2,631
  • 3
  • 20
  • 36
0
votes
1 answer

Systemd Wait for Mounts

My ultimate goal is to have docker wait for my mergerfs mount before it starts docker and for mergerfs to wait for 3 rclone mounts before it starts itself. I've tried 'requires' and bash script for 'execprestart' and 'requiresmountsfor', 'wants=',…
Danny Michel
  • 61
  • 1
  • 1
  • 11
0
votes
1 answer

Filter System.out.println messages in journalctl by Error, Warn, Info

How can I Filter Messages in Java, that is controlled by Systemd? At the moment, I'm writing logs using System.out.println like this: System.out.println("Hello this is a Error"); and the Journalctl -b -u test.service gives me this: Nov 02 11:58:41…
Morty
  • 91
  • 8
0
votes
0 answers

Docker file TLJH privileged access

In the following tutorial for installing TLJH on a docker: https://tljh.jupyter.org/en/latest/contributing/dev-setup.html The docker file has privileged access: --privileged \ Does anyone know why? Is it necessary to let the docker running TLJH…
zape
  • 105
  • 1
  • 6
0
votes
1 answer

Symfony 6 - stop and start Message Messenger systemd worker as www-data user via PHP

I am currently working on a Symfony 6 project. Now I have the situation that I want to stop and start a systemd service which is used to consume the messages from the Symfony Messenger message queue. The service is called "messenger-worker@.service"…
schwaluck
  • 115
  • 9
0
votes
0 answers

Monitoring a postgresql db process with telegraf using procstat input plugin send running=0i for active running state

I'm monitoring a postgresql db process with telegraf and procstat input plugin, but it's not seems to be working as expected in all machines(master and slaves). The input plugin configuration is like below: [[inputs.procstat]] systemd_unit =…
0
votes
0 answers

creating docker container for gpsd with auto usb option

Docker noob here.. I want to dockerize my project. There is gps module in it. I can use python gpsd library with autousb option true. It automatically detects the usb port if it is connected. However I want to dockerize this option but could not…
nogabemist
  • 402
  • 5
  • 29