Questions tagged [systemd]

systemd is an alternative approach to SystemV and Upstart init daemons for Linux. It is intended to provide a better framework for expressing services' dependencies, allow more work to be done in parallel at system startup, and to reduce shell overhead.

systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux cgroups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It can work as a drop-in replacement for sysVinit.

One of the most common questions about systemd on StackExchange is "Why doesn't my app work under systemd when I can run it directly?."

More here at http://0pointer.de/blog/projects/systemd.html#faqs

4581 questions
179
votes
1 answer

Executing chdir before starting systemd service

Question: Can I kick off a process with systemd and assign that process a working directory of my choosing? I have a service that I want to start with systemd. When that service is being started, I want to be able to assign it a current working…
Mario
  • 1,985
159
votes
5 answers

systemctl status shows : "State: degraded"

When I run systemctl status, I get State: degraded at the top, ● x230 State: degraded Jobs: 0 queued Failed: 1 units Since: Wed 2018-05-30 17:09:49 CDT; 3 days ago .... What's going on, and how do I fix it?
Evan Carroll
  • 30,763
  • 48
  • 183
  • 315
155
votes
3 answers

Why do most systemd examples contain WantedBy=multi-user.target?

I have read what is multi-user.target and the systemd documentation, which states that the multi-user.target is a special target. Further, a lot of the systemd examples contain that line. Why do so many example services contain that line? What…
Carl
  • 1,653
123
votes
2 answers

What are the systemctl options to "List all failed units"

systemctl Returns a list of the units, whether they are loaded, active, their sub and description. systemctl is-failed Returns a list of status only. What is the syntax to return the details of the failed units?
Tai Paul
  • 1,341
107
votes
5 answers

Systemd Restart=always is not honored

Note: I wrote an article on Medium that explains how to create a service, and how to avoid this particular issue: Creating a Linux service with systemd. Original question: I'm using systemd to keep a worker script working at all…
BenMorel
  • 4,587
67
votes
2 answers

What is systemd's target, service and socket?

I know that all of them are unit files, but I can't understand the special meaning of them. I think that targets are similar to daemons and sockets are the same as socket (IP + port) but also with inode numbers. Could anyone please explain them in…
drpaneas
  • 2,320
61
votes
2 answers

How to override systemd unit file settings?

I have installed MySQL on my Arch Linux server. I moved the data directory to a place under /home, where my RAID volume is mounted. I noticed that mysqld will not start in this configuration by default since the systemd unit contains the setting…
fdmillion
  • 2,828
61
votes
2 answers

Confused by ExecStartPre entries in systemd unit file

I have a systemd service that needs to create a directory in /run, but otherwise run as a non-root user. From a blog example, I derived the following solution: [Unit] Description=Startup Thing [Service] Type=oneshot ExecStart=/usr/bin/python3 -u…
53
votes
2 answers

Systemd: Requires vs wants

Is there any difference between Requires vs Wants in target files? [Unit] Description=Graphical Interface Documentation=man:systemd.special(7) Requires=multi-user.target Wants=display-manager.service Thanks
Iewicz
  • 673
52
votes
2 answers

Systemd service runs without exiting

I created my own service for jekyll and when I start the service it seems like it doesn't run as a background process because I am forced to ctrl+c out of it. It just stays in the foreground because of the --watch. I am not sure how to go around it…
49
votes
5 answers

Why won't my enabled systemd service start on boot?

I have the following systemd unit file in /etc/systemd/system/emacs.service: [Unit] Description=Emacs: the extensible, self-documenting text editor Documentatin=man:emacs(1) info:Emacs [Service] Type=forking ExecStart=/usr/bin/emacs…
Startec
  • 1,879
49
votes
1 answer

Is it possible to manually execute a single systemd timer-paired service unit for testing purposes?

I have a timer/service unit-set that should run once a day under --user conditions. It shows up with systemctl --user status and gets logged in journal but there is a part of the command that fails. It seems that something in the command is not…
Gus
  • 643
  • 1
  • 6
  • 9
45
votes
3 answers

Where is / why is there no log for normal user systemd services?

I'm trying to learn basic systemd usage and I've run into a confusing issue with user service units. When running ordinary services with systemctl start some.service I can find the full log for this service (including what it has printed to stdout /…
40
votes
3 answers

generic methodology to debug ordering cycles in systemd

I am aware of following thread and supposedly an answer to it. Except an answer is not an answer in generic sense. It tells what the problem was in one particular case, but not in general. My question is: is there a way to debug ordering cycles in a…
galets
  • 1,177
40
votes
5 answers

Systemd user unit that depends on system unit (sleep.target)

I was reading doc and it is still unclear for me, whether the following is possible to accomplish: service defined in ~/.config/systemd/user/task.service that depends on system sleep.target…
1
2 3
35 36