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

Nitrogen through systemd services doesn't work

I am writing a tool (zxcV32/OpenRWC) that fetches wallpapers from Reddit and sets them to the monitor(s) using nitrogen. To make it easy to install and run automatically, I have created a deb package and a systemd service. When the service is…
zxcV32
  • 74
  • 1
  • 4
0
votes
2 answers

Failing to start an app as service through systemd using userdata

I want to start my app as service from systemd but the app is not starting. My unit file appstart.service looks like this: [Unit] Description=Application start [Service] Type=simple User=ec2-user ExecStart=/usr/bin/bash…
Alex
  • 97
  • 8
0
votes
0 answers

How to enable output colors on nodejs running as systemd service

I have a websocket client that sends periodically some message to websocket server. If I run the client from the tty, console colors work fine and the message sent to WebSocket are colorized. But if I execute this same client as a systemd service.…
0
votes
0 answers

Could NOT find LibSystemd (missing: SYSTEMD_UNIT_DIR) seen while using cmake

CMake complains about "No package 'systemd' found" though I have installed systemd on docker container of Ubuntu 20.04. Why cmake is not able to detect the installed pkg root@e8208b70072e:/opt/dev/sysrepo/build# cmake .. -- ietf-yang-library…
myquest4 sh
  • 371
  • 4
  • 16
0
votes
1 answer

How to pass array argument (ia(sb)) to gdbus method call,

I am trying to use the systemd API (SetLinkDomain) with gdbus bindings, below is the example code, GVariant *BuidArray() { GVariantBuilder *struc = g_variant_builder_new(G_VARIANT_TYPE("(sb)")); const char *name = "abc.net"; …
0
votes
1 answer

Cant access environment variable in Python for systemd service

I was writing a systemd service named 'spliti3.service' which executes a Python script in /usr/bin/ to help automatically adjust windows within 2 columns vertically for my i3wm. In my /etc/systemd/system/spliti3.service: [Unit] Description=Launches…
RAZ0229
  • 193
  • 4
  • 14
0
votes
1 answer

Change service systemd status from it's code

I have a C++ programm and it has two runtime states: active and waiting. I want to be able to change systemd status of the corresponding server (systemctl status) from the code. I have seen that there are "active (running)" and "active (waiting)"…
0
votes
1 answer

How can I set SO_REUSEPORT on the socket

How can I modify the server_http.hpp file in the Http Server Library to set SO_REUSEPORT on the socket? Or how can I pass in a fd. (the systemd .socket file will need ReusePort=yes for…
island slangz
  • 105
  • 2
  • 7
0
votes
1 answer

How to start systemd user service when device is removed, and stop it when device is inserted

Systemd allows starting/stopping service from udev rule using SYSTEMD_USER_WANTS environment and StopWhenUnneeded option. But, service will be started when device is inserted and stopped when device is removed. What I need is vice versa: start…
V_V
  • 612
  • 9
  • 23
0
votes
0 answers

Fluentbit filter with multiple systemd identifiers and log levels

I am trying to filter the systemd logs using fluentbit with different log levels. The requirement is to exclude the log-level 7 for certain services while excluding log-level 4-7 for another service. My config currently looks like…
0
votes
0 answers

systemd script for notify-send fails with error "The connection is closed"

I am trying to run a systemd timer. I am posting all the relevant files and the error below. I have posted the nodejs file but I tried with a simple shell script as well as explained in the Edit…
Rounak Jain
  • 409
  • 1
  • 5
  • 18
0
votes
0 answers

Can we restart wildfly based on output of server.log file?

I have created a script which would check the server.log file during shutdown and startup as it is proprietary to check the log. And based on that output appropriate step is taken. The problem I am facing now is that whenever i do grep -m 1 "stopped…
Birat
  • 1
0
votes
1 answer

How to execute multiple command in ExecStart

I wanted to use systemd to archive some logs periodically. However, it does not work as I wanted it to. According to my test, the second part of in string command failed and I really have no idea what going wrong. Would appreciate if anyone could…
gtfonow
  • 13
  • 1
0
votes
1 answer

Double hourly notification Python, Ubuntu, Telegram

When developing the telegram bot in python, I faced the problem of independently triggering notifications in the Ubuntu system. Let's start from the beginning. For everyday notification, I use a library called "Schedule". I won't fully describe it…
Friken
  • 13
  • 4
0
votes
1 answer

Starting an opensplice publisher via systemd does not publish data

I have an opensplice publisher on Ubuntu 20.04 that is started via systemd. If the publisher starts via systemd then the data is not pubished, but also no errors are reported or present in the opensplice log files. The publisher works if I run it…
Damian Dixon
  • 889
  • 8
  • 21