systemd

systemd.network management

systemd.network management I try to follow the manual example from man systemd.network: # /etc/systemd/network/27-xfrm.netdev [NetDev] Name=xfrm0 Kind=xfrm [Xfrm] InterfaceId=7 # /etc/systemd/network/27-eth0.network [Match] Name=ens5 [Network] Xfrm=xfrm0 Then systemctl daemon-reload + systemctl restart systemd-networkd. And – nothing. In systemctl status systemd-networkd it also does not show any references to xfrm: Apr 16 23:52:07 ip-10-100-1-205 systemd[1]: Starting Network …

Total answers: 2

Force reboot if `fstab` mount fails instead of going to emergency mode

Force reboot if `fstab` mount fails instead of going to emergency mode I have a fstab with read-only root-fs and also a rw /var mounted on a USB reader with a uSD in it. Sometimes at boot time system fails to mount /var. It looks like that the system cannot find the partition on the …

Total answers: 2

loginctl enable-linger error Could not enable linger: Access denied

loginctl enable-linger error Could not enable linger: Access denied I have 2 Ubuntu 20.04 servers. One of them gives me this error. Could not enable linger: Access denied when running loginctl enable-linger The other server doesn’t raise any errors. I did a bit of research, but I could not find a solution to my problem. …

Total answers: 1

Is there a way to schedule a lazy timer relative to another timer?

Is there a way to schedule a lazy timer relative to another timer? (x-mas.service) [Unit] Description=Celebrate X-Mas [Service] Type=simple ExecStart=/usr/sbin/x-mas-day [Install] WantedBy=multi-user.target (x-mas.timer) [Unit] Description=Add "X-Mas" to the calendar [Timer] OnCalendar=*-12-25 00:00:00 Unit=x-mas.service [Install] WantedBy=timers.target (buy-presents.service) [Unit] Description=Get your wallet out Requires=x-mas.service Before=x-mas.service [Service] Type=simple ExecStart=open-amazon-dot-com.sh [Install] WantedBy=multi-user.target (buy-presents.timer) [Unit] Description=Buy presents Before=x-mas.timer Requires=x-mas.timer [Timer] …

Total answers: 1

reboot via dbus-send without interaction?

reboot via dbus-send without interaction? trying to investigate why handbrake and kodi cannot shutdown or reboot my system, I narrowed the problem down to these "Interactive authentication required" messages: % dbus-send –system –print-reply –dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:false Error org.freedesktop.DBus.Error.InteractiveAuthorizationRequired: Interactive authentication required. % dbus-send –system –print-reply –dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.Reboot boolean:true Error org.freedesktop.DBus.Error.InteractiveAuthorizationRequired: Interactive authentication required. …

Total answers: 1

I have deleted systemd

I have deleted systemd I am a Debian user. I deleted systemd without installing anything else. I ran sudo apt remove systemd. After that, I ran sudo apt autoremove systemd. After that, my laptop can’t connect to the internet, and it doesn’t get me to use the GUI; I’m stuck in the command line interface …

Total answers: 1

How do I automatically set the target context for a .sock file to be **httpd_var_run_t** so that nginx can connect to and write to the socket?

How do I automatically set the target context for a .sock file to be **httpd_var_run_t** so that nginx can connect to and write to the socket? The original file context for /run/unicorn.sock is tcontext=system_u:object_r:var_run_t:s0 How do I have the file context automatically be system_u:object_r:httpd_var_run_t:s0 when I start the socket unit so that the nginx server …

Total answers: 1

fstab and systemd automount overlay

fstab and systemd automount overlay On an embedded device based on Yocto Linux my rootfs is RO, while I have an additional partition for RW data. Now I want to automount at boot an overlay onto /etc stored on a different partition. Here is my fstab: /dev/mmcblk0p6 /data_local ext4 defaults,sync,noexec,rw 0 2 […] overlay /etc …

Total answers: 1

send notification from one systemd unit to another with python?

send notification from one systemd unit to another with python? I have a systemd unit ‘my-app’ that runs my main python app but I want it to auto-update when there is a new version on a remote server. The detection is watched by another python systemd unit (let’s call it "watch-app") on the same OS …

Total answers: 1

Where do args passed to systemd have to reside?

Where do args passed to systemd have to reside? Arguments or -flags can be passed to systemd systemctl when e.g. starting a service. But do the args need to reside in the service systemd somewhere else In other words, must the args be callable to/by the service itself (as I assume)? Asked By: Johan || …

Total answers: 1

How to specify dynamic "Environment" variables in a systemd unit file?

How to specify dynamic "Environment" variables in a systemd unit file? This $(ls -d…) does not work in a systemd unit file: [Service] Type=forking Environment="ORACLE_HOME=$(ls -d /usr/lib/oracle/*/client64 | sort -rV | head -n1)" Environment="TNS_ADMIN=$(ls -d /usr/lib/oracle/*/client64/lib/network/admin | sort -rV | head -n1)" I want to avoid hard-coding the Oracle client version (at the moment 19.19), …

Total answers: 1

What exactly does it mean for a systemd service to be "activating"?

What exactly does it mean for a systemd service to be "activating"? According to various clauses in the docs, the "activating" state is the transition between inactive states and an active state. So far so obvious. But how exactly is it defined? What determines whether a service is no longer inactive but activating? What determines …

Total answers: 1

Wait for systemd oneshot service before shutdown

Wait for systemd oneshot service before shutdown I’m trying to setup automatic execution of a process using a systemd timer and service. The problem is that my oneshot service gets immediately killed on shutdown. How can I tell systemd to not kill oneshot services but wait for it to finish before shutdown? My test.service looks …

Total answers: 1

Systemd service starting before filesystem mount after power loss

Systemd service starting before filesystem mount after power loss I’m encountering an issue with a systemd service starting before a local partition is mounted, particularly after a power loss event. I’ve investigated and found that this problem arises due to a system reboot and subsequent fsck operation. To easily replicate the problem, I’ve created a …

Total answers: 1

need help creating a non-root systemd service

need help creating a non-root systemd service I’m using ubuntu 22 and currently have a user and group named "steam" When I want to run my cs2 server , I first switch to steam user : su steam Then I run the following command : cs2-server @public1 start The above command doesn’t run as root …

Total answers: 1

Systemd does not see external drive partition when running ExecStart command

Systemd does not see external drive partition when running ExecStart command I am trying to run calibre-server at startup. Here is an example of the service content [Unit] Description=calibre Content server After=network.target [Service] Type=simple User=root Group=root ExecStart=/opt/calibre/calibre-server "/path-to-mounted-external-hdd-partition/Calibre Library" [Install] WantedBy=multi-user.target When I check the status of the service: sudo systemctl status calibre-server.service I receive …

Total answers: 4

systemd+ – cannot stop mongo service

systemd+ – cannot stop mongo service I noticed mongo was listening on port 27017 I tried to stop it with: $ sudo systemctl stop mongod Failed to stop mongod.service: Unit mongod.service not loaded. and then I did: sudo service mongod stop Failed to stop mongod.service: Unit mongod.service not loaded. then I had to do: ps …

Total answers: 1

create a dependencies for services with systemd

create a dependencies for services with systemd im trying to create a ServiceB that start after ServiceA starts. This is what i tried to do : ServiceA file: [Unit] Description=ServiceA After=network.target [Service] ExecStartPre=running some shell script…. ExecStart=running some shell script…. ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure RestartPreventExitStatus=255 TimeoutStopSec=10 [Install] WantedBy=multi-user.target first ServiceB file try: [Unit] Description=ServiceB …

Total answers: 1