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.

systemd is intended to make the boot process faster and more efficient when compared with pre-existing init systems, such as by using parallelization.

More detailed technical information about systemd can be found on the Ubuntu Wiki and Wikipedia. Freedesktop.org also has a page for systemd.

Lennart Poettering, the author of systemd, has a blog post providing background on why systemd is needed, including some history on other init systems such as Upstart.

systemd is still considered controversial by some; many of these reasons are listed on without-systemd.org. Lennart Poettering also wrote a blog post in defense of systemd. Regardless, many major Linux distributions are switching to it. This includes Ubuntu since its parent distribution, Debian, is one of them. Ubuntu now uses systemd by default starting with Ubuntu 15.04.

1636 questions
248
votes
2 answers

How do I make my systemd service run via specific user and start on boot?

I just upgraded from Ubuntu server 14 to version 15. I had trouble getting my upstart script working after the upgrade, and read that systemd is the new default. I'm far from a linux expert, so please go easy on me :-) Here is what my upstart script…
void.pointer
  • 2,655
  • 2
  • 15
  • 12
110
votes
4 answers

Why are some systemd services in the "masked" state?

When I run the command sudo systemctl list-unit-files (I think the sudo is optional), I get output which shows all services and their state. Here is a snippet from my machine: UNIT FILE STATE ... debian-fixup.service…
knb
  • 5,004
58
votes
4 answers

systemctl, how to unmask

root@gcomputer:~# systemctl status x11-common ● x11-common.service Loaded: masked (/dev/null; bad) Active: inactive (dead) I tried systemctl unmask x11-common and systemctl unmask x11-common.service but that did not change anything. How do I…
Albert
  • 2,577
52
votes
1 answer

How do I properly install a systemd timer and service?

I am attempting to create and install on Bionic a custom pair of systemd timer & service units for running a command periodically. I know that the files should be placed in /etc/systemd/system and then I should run systemctl daemon-reload, but I'm…
jwodder
  • 787
39
votes
5 answers

How do I disable the systemd OOM process killer in Ubuntu 22.04?

Ubuntu 22.04 comes with the systemd-oomd service enabled by default, which has been "helpfully" killing my IDE and / or terminals whenever I try to compile an application using an abundance of threads / memory. What is the right way to either turn…
Kevin Ushey
  • 811
  • 1
  • 7
  • 11
36
votes
1 answer

systemd is hanging when I start or restart a service

I'm new to systemd after upgrading to 16.04 and I'm encountering a problem with starting and restarting services. When I run (for example)... systemctl start djalbat.com ...it seems to work, however I don't get the prompt back, it just appears to…
33
votes
4 answers

How do I add ~/bin to PATH for a systemd service?

I have a systemd service which calls a PHP script that creates a tmux session on boot. Globally I have the most current tmux for the distro (V>=2.5). The script's USER has a $HOME/bin/tmux of 2.0 What I need is for this systemd to use the tmux…
Mark
  • 1,502
20
votes
2 answers

systemd: How to start service B after service A runs to completion?

I need to emulate the Upstart "start on stopped" behavior, in which service B is started after service A runs to completion, but in systemd. How do I do that? I've seen references to the "After=" and "Before=" clauses in the [Unit] section of the…
SteveKier
  • 611
  • 1
  • 5
  • 8
19
votes
2 answers

How to read systemd journal file on system that has no systemd?

I am trying to troubleshoot a system (Arch Linux) that had systemd installed. The volume has been mounted on an Ubuntu system (14.04) that has no systemd installed. How can I troubleshoot said systemd journal without switching the host box to…
jottr
  • 765
11
votes
3 answers

systemctl status not showing CPU/Memory usage?

I used Ubuntu 16.04. And I find some services will show cpu and memory usage via systemctl status .service: $ systemctl status nginx ● nginx.service - LSB: Stop/start nginx Loaded: loaded (/etc/init.d/nginx; bad; vendor preset: enabled) …
Feng Yu
  • 877
  • 3
  • 8
  • 17
10
votes
2 answers

Restart systemd service on file change?

I'm new to systemd and would like to know what is the best strategy for restarting my web application whenever I deploy new version. Currently I start my service on boot and it just sits there, however I would like it to restart automatically…
sed
  • 511
8
votes
2 answers

pass environment variables to services started with systemctl

I have a nodeJS service built using NodeJs. This service requires some environment variables to be passed to it. Moreover, I created a systemd unit file to start it from systemctl. For some weird reasons, the service, when started with systemctl,…
8
votes
1 answer

How would I upgrade systemd?

I read today that systemd has been updated to version 220 over on It Runs On Linux. I was wondering a couple of things not included in the article and pertaining specifically to ubuntu 15.04. As the title states, how would I update systemd? It…
user402585
8
votes
1 answer

enabled systemd service not starting

I have two systemd services, one is a flask app meant to proxy calls to a C backend. While the flask app works the C program does not start at boot. My service file looks like this: [Unit] Description=my…
Bok
  • 361
7
votes
1 answer

Make a systemd service run as user xyz

I've created a .service file that includes User=xyz in the [Service] section. The service still runs as root. Quid? [Unit] Description=... Requires=network-online.target [Service] ExecStart=/usr/bin/java ... Type=simple ExecStop=/usr/bin/java…
1
2 3 4 5 6 7 8