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

4022 questions
830
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
  • 8,629
  • 4
  • 14
  • 16
481
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
  • 5,523
  • 4
  • 14
  • 22
282
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,203
  • 10
  • 30
  • 32
279
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
  • 2,993
  • 3
  • 15
  • 8
231
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,455
  • 2
  • 10
  • 9
191
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
  • 61,932
  • 85
  • 220
  • 285
175
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,945
  • 2
  • 11
  • 8
174
votes
5 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
  • 4,942
  • 6
  • 27
  • 50
163
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,378
  • 2
  • 15
  • 18
141
votes
2 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,511
  • 2
  • 7
  • 4
135
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,528
  • 3
  • 19
  • 21
122
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
  • 23,871
  • 35
  • 131
  • 233
122
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,551
  • 3
  • 13
  • 20
117
votes
3 answers

Writing basic systemd service files

I am developing a Nodejs application that the user interacts with via HTTP on localhost. There are practically no parameters and the daemon has virtually no dependencies and it just needs to be up by log-in time. I would like to follow the idioms on…
beatgammit
  • 7,203
  • 10
  • 30
  • 32
116
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
  • 1,882
  • 4
  • 14
  • 22
1
2 3
99 100