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

4395 questions
939
votes
6 answers

How to see full log from systemctl status service?

I check service status with systemctl status service-name. By default, I see few rows only, so I add -n50 to see more. Sometimes, I want to see full log, from start. It could have 1000s of rows. Now, I check it with -n10000 but that doesn't look…
10robinho
  • 9,759
  • 4
  • 16
  • 16
554
votes
13 answers

How to clear journalctl

I couldn't find in google any safe way to clear systemd journal. Do anyone know any safe and reliable way to do so? Let's say I was experimenting with something and my logs got cluttered with various error messages. Moreover I'm displaying my…
Łukasz Zaroda
  • 6,083
  • 4
  • 17
  • 24
299
votes
2 answers

View stdout/stderr of systemd service

I have created a simple systemd service file for a custom application. The application works well when I run it manually, but my CPU gets maxed out when I run it with systemd. I'm trying do track down where my problem is, but I don't know where to…
beatgammit
  • 7,453
  • 10
  • 31
  • 32
290
votes
2 answers

How to write startup script for Systemd?

I have 2 graphics cards on my laptop. One is IGP and another discrete. I've written a shell script to to turn off the discrete graphics card. How can I convert it to systemd script to run it at start-up?
Sharique
  • 3,113
  • 3
  • 16
  • 8
258
votes
12 answers

The "proper" way to test if a service is running in a script

My problem: I'm writing a bash script and in it I'd like to check if a given service is running. I know how to do this manually, with $ service [service_name] status. But (especially since the move to systemd) that prints a whole bunch of text…
Nick S
  • 2,725
  • 2
  • 11
  • 9
206
votes
6 answers

Where do I put my systemd unit file?

I read that there are two folders for unit files (not in user mode). /usr/lib/systemd/system/: units provided by installed packages /etc/systemd/system/: units installed by the system administrator Conflicting with this understanding is the answer…
Jonathan Komar
  • 5,974
  • 7
  • 33
  • 52
196
votes
6 answers

What are the pros/cons of Upstart and systemd?

It appears systemd is the hot new init system on the block, same as Upstart was a few years ago. What are the pros/cons for each? Also, how does each compare to other init systems?
tshepang
  • 64,472
  • 86
  • 223
  • 290
177
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,965
  • 2
  • 12
  • 8
174
votes
2 answers

How does systemd use /etc/init.d scripts?

I just switched to debian jessie, and most things run okay, including my graphical display manager wdm. The thing is, I just don't understand how this works. Obviously my /etc/init.d/wdm script is called, because when I put an early exit in there,…
Martin Drautzburg
  • 2,498
  • 3
  • 16
  • 18
172
votes
3 answers

What does "systemctl daemon-reload" do?

I have a service that stopped suddenly. I tried to restart that service but failed and was asked to run: systemctl daemon-reload. What does it exactly do? What is a daemon-reload?
John
  • 1,821
  • 2
  • 9
  • 4
148
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
  • 28,578
  • 45
  • 164
  • 290
142
votes
7 answers

Cause a script to execute after networking has started?

I am relatively new to systemd and am learning its architecture. Right now, I'm trying to figure out how to cause a custom shell script to run. This script needs to run after the networking layer has started up. I'm running Arch, using systemd as…
fdmillion
  • 2,748
  • 3
  • 20
  • 21
141
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,513
  • 2
  • 10
  • 6
136
votes
7 answers

journalctl: how to prevent text from truncating in terminal

How can I keep long strings from truncating in terminal? For example if I run journalctl -xn There's a lot of text that I cannot read. I am open to using other programs/tools.
P.Brian.Mackey
  • 1,691
  • 3
  • 15
  • 20
126
votes
12 answers

How to avoid conflicts between dnsmasq and systemd-resolved?

I recently installed dnsmasq to act as DNS Server for my local network. dnsmasq listens on port 53 which is already in use by the local DNS stub listener from systemd-resolved. Just stopping systemd-resolved and then restart it after dnsmasq is…
vic
  • 2,012
  • 4
  • 14
  • 23
1
2 3
99 100