Questions tagged [systemd]
systemd is a collection of daemons, libraries and tools for system management. Ubuntu's Upstart system was replaced with systemd starting with Ubuntu 15.04.
1,639
questions
2
votes
1
answer
10k
views
How to setup static IP with wireless interface and netplan on ubuntu 22.04?
I am trying to setup a static ip for a ubuntu server 22.04 instance on a laptop. I though I am going to do that by modifying netplan configuration.
IP of router is 192.168.80.32
netplan config file is
...
2
votes
1
answer
280
views
Restart systemd service when GPU memory limit is reached
I'm using the following systemd service on Ubuntu 22.04 LTS. The service is saved in /lib/systemd/system/myService.service
[Unit]
Description=myService
RequiresMountsFor=/mnt/Data
[Service]
ExecStart=...
0
votes
2
answers
872
views
Preventing Ubuntu from asking for password for encrypted data partition at startup (Ubuntu 20.04)
I'm using Ubuntu 20.04.
I have a (LUKS) encrypted partition that I do not want to be prompted to mount on startup (at minimum, not providing a password for it on startup should not block the system ...
0
votes
0
answers
89
views
Ubuntu22.04 - fail to run script using systemd
I need to run a script at every boot. For that, I've create a .sh file, which runs as needed using a terminal.
To make it run during boot, I followed this tutorial.
.sh file:
#! /bin/bash
sub1="...
0
votes
0
answers
233
views
Upgrade to 20.04 broke from 18.04
Although some diag tool (boot-repair: report here) run from 22.04 live USB (probably EFI) states the system is 20.04 and maybe missing an EFS partition, it never had (upgrade was run from 18.04 just ...
8
votes
1
answer
1k
views
journalctl -u sshd.service command returns 'no entries'
I am currently working on Ubuntu 20.04 machine. When I am running the command journalctl -u sshd.service, I am getting the below response.
-- Logs begin at Wed 2022-12-21 13:01:52 UTC, end at Fri 2023-...
1
vote
1
answer
1k
views
Cannot use systemctl as a user after a "sudo su - media" : Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined
I'm trying to create a service as a user but it does not work :
admin $ sudo su - media
$ systemctl --user edit fmgr-copro.service --full --force
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS ...
1
vote
1
answer
416
views
How to move already running processes to different `cgroup` with systemd?
I'm using Ubuntu 20.04 LTS with MATE desktop which doesn't natively support launching desktop UI and window manager in a separate cgroup from the other applications.
Is it possible to run some systemd ...
0
votes
1
answer
616
views
systemd service fails to start script in home directory
I would like to start a python script (i.e. a Flask server) at boot of Ubuntu 22.04. I have created a file /lib/systemd/system/myService.service with following content:
[Unit]
Description=The service ...
0
votes
0
answers
61
views
Trying to get timing of systemd script right
I have this script that I'm trying to get the system to execute on shutdown and only on shutdown (or restart for that matter). This script doesn't start or stop a server; it merely unmounts some file ...
0
votes
1
answer
373
views
CPUAffinity in /etc/systemd/system.conf getting messed up when docker/snap is installed
For some benchmarking purpose I need to set CPUAffinity for the entire system to limit all process to some cores lets say first 10 cores. This way I can do taskset to override the CPUAffinity and ...
0
votes
0
answers
196
views
Problem mounting /boot and swap
After reboot of Ubuntu-2110 on my Hetzner VPS I found myself in a no boot situation.
Based on journalctl I had an issue starting a target for swap and boot partitions. It takes 1.5min and fails ...
2
votes
0
answers
431
views
How to configure cgroup resource limits for desktop applications using official systemd features?
I've previously used cgmanager to group processes in separate cgroups and adjust memory and CPU limits as needed for each group. However, modern systemd doesn't want that other processes mess with ...
0
votes
0
answers
48
views
systemd service doesnt start
i have a problem with a systemd service and i cant find the problem.
I have script in the directory /home/username/test/ called battery.sh:
#!/bin/sh
max=99999
for i in `seq 1 $max`
do
clear
...
4
votes
0
answers
2k
views
How to dermine why a systemd service is not stopping on shutdown? (stop job is running)
Recently every time I shut down or reboot my laptop, it is slow to shut down, and shows the following message:
A stop job is running for Session c1 of User gdm
I tried several similar questions that ...
1
vote
0
answers
91
views
How can I pass the FQDN hostname to systemd?
I have an Ubuntu 20.04 system in AWS. The %H flag in systemd is replaced with the hostname as expected, but I need a way to capture the output of hostname --fqdn.
%H outputs ip-10-0-0-188 on my ...
9
votes
4
answers
9k
views
How to run a docker-compose as a systemd service?
I found this question, but that one uses cron - I'd like to use a systemd service instead. My docker-compose.yml is in /home/me, and I run it with sudo docker compose up (and just keep it running in ...
1
vote
0
answers
175
views
Why would a user created systemd service stop forwarding to syslog?
TLDR: I have a centralized syslog server that suddenly stopped receiving syslog message from applications servers. Messages only resumed when I restarted each individual service running on every app ...
2
votes
1
answer
182
views
How increase the "loaded units" systemd
we use chrome remote desktop to perform remote access to ubuntu, but I am not able to enable more than 32 users (each user is a systemctl unit and after reaching 32 unit loaed, I cannot start others).
...
0
votes
1
answer
395
views
Why is rootless docker still running as root inside container?
From a non-root testuser which is a non sudo account, I have installed a rootless docker following the instruction here (Ubuntu without package).
When I start a container and go inside it by running ...
0
votes
1
answer
374
views
Systemctl cannot start service which uses ttyACM0 port after reboot
I need to start my own service (SignalR client) written in C# (.NET6) after ttyACM0 port is available. This service should be started after other service (SignalR server).
The server service starts ...
1
vote
1
answer
7k
views
How to debug: Failed to connect to bus: No such file or directory (systemctl --user status)?
I am trying to run systemctl --user status from a user account in order to not run services from root.
The way I do it is as follows:
loginctl enable-linger $USER
export XDG_RUNTIME_DIR="/run/...
2
votes
1
answer
301
views
Network related part of a script will not run in /lib/systemd/system-sleep
The purpose of the script is to re-enable a hidden SSID upon resume from sleep. Somehow the ability to restart a hidden SSID automatically was lost when I upgraded from 18.04 LTS to 20.04 LTS.
You ...
0
votes
1
answer
2k
views
stopping Networkmanager and wpa_supplicant : FAIL on shutdown or on restart
Ubuntu 22.04 Jammy Jellyfish
reboot or shutdown fail because NetworkManager and wpa_supplicant can't stop.
If I stop NetworkManager and wpa_supplicant by hand before shutdown, shutdown works fine, ...
0
votes
0
answers
46
views
System randomly freezes; unable to access terminal; restart fixes for a couple days
I'm having this weird issue where after a while, my system just locks up. None of the CTRL+ALT+F* keys bring up the terminal or login, and only after a restart do things work again. During the time ...
1
vote
0
answers
177
views
Custom systemd service won't start automatically
I wrote a script and a service to power down my external Seagate drive on shutdown. It worked the first time but when I restart my computer it won't activate. I always have to start it manually before ...
1
vote
0
answers
127
views
How to configure systemd to put all my browsers in a single cgroup
Long time ago I used cgmanager to put all my browsers (Opera, Firefox, Chrome) in a single cgroup and set max RAM usage limit for that group.
However, modern systemd really doesn't want other programs ...
3
votes
1
answer
3k
views
Who/what is creating /dev/loop0, /dev/loop1, ... /dev/loop7?
I've recently been working on a project requiring encrypted files mounted via a connection to a loop device. While the project will run on an Ubuntu system, I was experimenting with setting it up on ...
1
vote
3
answers
525
views
Ubuntu 20.04 mounting swap even if disabled
TLDR:
A fully updated ubuntu 22.04 server is still mounting swap even after removing it from /etc/fstab
I am about to pull my hair over this issue.
I've been reading the ubuntu documentation about ...
0
votes
0
answers
1k
views
Mount not working with systemd (working with /etc/fstab)
I have a working line in /etc/fstab for mounting a remote samba server
//192.168.1.11/wind /media/fixe/wind cifs noauto,user,username=XXX,password=YYY,rw 0 0
But I would now use automount ...
0
votes
1
answer
806
views
Service restarted at every apt upgrade
Everytime I run apt upgrade and there is an actual upgrade, a service that I have created gets restarted.
Typically, I get this message
┌────┤ Daemons using outdated libraries ├─────┐
│ ...
3
votes
1
answer
2k
views
Running a systemd job with a delay when activated manually, not at boot
I am trying to set up a systemd job to run once, with a delay, after activating it specifically. I do not want it to run on boot. I had thought that the following timer file would do the trick:
[Unit]
...
0
votes
0
answers
749
views
Temporary failure in name resolution, Ping not working, Missing /etc/resolv.conf
$ ping google.com
ping: google.com: Temporary failure in name resolution
So I checked for /etc/resolv.conf but its missing
$ ll /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Jul 31 2020 /etc/resolv....
3
votes
1
answer
764
views
Passing "flag" Arguments to Systemd Services
I have a Systemd service that calls a script. That script takes it's own arguments, some of which are named arguments. I currently have the following service:
[Unit]
Description=My Service
...
2
votes
1
answer
510
views
wine (64bit prefix) fails url opening from the app
Launching KSPLauncher (Kerbal space program) everything works smoothly except this ...
every time I want to open some web links I see jumping firefox icon near my cursor for 3 seconds then nothing ...
1
vote
1
answer
847
views
Unit user-.slice failed to load properly: Invalid argument
I have been trying to set up resource controls on 22.04.1 login node so users can't degrade the system by running anything too intensive. I looked at using cgroups but apparently since it's a systemd ...
1
vote
0
answers
173
views
MySQL does not create socket when launched at boot
After a reboot, mysqld is running, but no socket gets created and you cannot connect to the MySQL server:
# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/...
1
vote
1
answer
282
views
systemd service won't boot at start
I'm running a service on a EC2 instance that should boot at start and whenever the script associated fails.
So I wrote the service like this:
[Unit]
Description=Test
[Service]
User=ubuntu
Type=simple
...
1
vote
1
answer
5k
views
Fix error: Cannot autolaunch D-Bus without X11 $DISPLAY on script to change wallpaper using systemd
Background
I have created a script that changes my wallpaper periodically. The script works perfectly fine when I run it from bash, but having to manually run it on every startup is becoming annoying, ...
2
votes
4
answers
2k
views
Running a script at shutdown before networking goes down
I would like to run a script when my computer (Ubuntu 22.04) shuts down, but while networking is still available.
The advice in this thread helpfully explained how to create a systemd service file ...
0
votes
1
answer
431
views
Enabling systemd support in WSL caused an resource invalid error
I upgraded my OS to Windows 11 in hopes of getting Systemd support in my WSL2 Ubuntu distro. But after I enabled the Systemd support using the documentation on Microsoft Developer blogs, I'm receiving ...
0
votes
1
answer
1k
views
what happens to stdout from an executable when running as systemd service
I'm setting up my app to run as systemd service for testing, i.e the app will change and it's currently generating output to stdout.
Is this an issue?
Can I view the output in real-time if I need to?
...
1
vote
2
answers
613
views
(r)sync between Ubuntu virtual machine and windows host using a shared folder (after start and before restart/shutdown
The host machine is windows. I have an Ubuntu virtual machine(vmware). There is a shared folder between Ubuntu and Windows.
The shared folder is mounted in /etc/fstab:
vmhgfs-fuse /...
0
votes
2
answers
872
views
Fluidsynth Starting Automatically On Boot; Login Freezing - Connected? How to Solve?
Since switching from Kubuntu 20.04 to Ubuntu Studio 22.04 (both use KDE Plasma), I have had a strange cluster of issues. I'm wondering if they could be connected, but my main goal is to find a ...
0
votes
0
answers
72
views
Should systemd be running as a sub-process of itself?
I just noticed in System Monitor that systemd is running as pid 1 AND that within that process it is listed as a dependent process of itself, running again under process 1 as pid 933 and with another ...
0
votes
1
answer
575
views
How do I disable screensaver and systemd suspend on Ubuntu 20.04 from command-line or configuration files?
I have seen a lot of solutions about gsettigns set and systemctl mask suspend.target ... but none works for me.
My Ubuntu 20.04 has Gnome GUI. And the only thing I want is to completely disable screen ...
2
votes
1
answer
493
views
How to allow SSH chroot user to restart apache on host?
My first post here on Ask Ubuntu.
I have an LAMP Ubuntu server which has two vhosts defined in /etc/apache2/sites-enabled.
One of these sites (an external mirror site) must be maintained by an ...
2
votes
1
answer
7k
views
Installing Jenkins, Service fails with result "timeout"
I am trying to install jenkins on my raspberry pi running Ubuntu Server 22.04. I am following the directions from Digital Ocean but I am getting a timeout error when installing Jenkins
> apt ...
2
votes
1
answer
2k
views
Current Method to Mount /tmp in 22.04 and Newer with noexec
I've read various other questions and answers and all of the guidance for mounting or changing the mount options for /tmp involve /etc/fstab or /etc/systemd/system/local-fs.target.wants/tmp.mount. ...
4
votes
1
answer
6k
views
Multiple UtilTranslatePathList errors when restarting Ubuntu on WSL after a shutdown
After performing a sudo systemctl poweroff in Ubuntu in WSL and restarting, I'm seeing:
<3>WSL (814) ERROR: UtilTranslatePathList:2671: Failed to translate C:\Program Files\PowerShell\7
<3>...