Questions tagged [systemd]

systemd is a modern replacement for the traditional Linux init. Its main features include the ability to express dependencies between services and aggressive parallelization of service startup.

systemd, created by Lennart Poettering and Kay Sievers, is a modern replacement for the traditional Linux init, whether System-V or BSD-style initscripts. Its main features include the ability to express dependencies between services and aggressive parallelization of service startup.

1567 questions
433
votes
6 answers

How to set environment variable in systemd service?

I have an Arch Linux system with systemd and I've created my own service. The configuration service at /etc/systemd/system/myservice.service looks like this: [Unit] Description=My…
lfagundes
  • 4,433
286
votes
2 answers

Do systemd unit files have to be reloaded when modified?

Let's say I write a mine.service file. Then I use systemctl enable mine.service. If I later decide to edit mine.service, do I have to tell systemd that mine.service was changed? If so, how do I do that?
425nesp
  • 3,132
188
votes
4 answers

Find the location of a systemd unit file service

There are many different places where systemd unit files may be placed. Is there a quick and easy way to ask systemd where it read a service’s declaration from, given just the service name?
145
votes
6 answers

In systemd, what's the difference between After= and Requires=?

I'm creating a systemd .service file and I need help understanding the difference between Requires= and After=. The man page says that Requires= "Configures requirement dependencies on other units." and After= "Configures ordering dependencies…
TomOnTime
  • 8,381
115
votes
3 answers

Is there a way to see the execution tree of systemd?

What I mean under the question is: is there a way to dump the ordered list (like pstree does for processes) to see how systemd executed the supplied set of units, i.e. the tree after the dependencies were resolved and jobs were queued for the…
galaxy
  • 2,227
112
votes
3 answers

Does getting disconnected from an SSH session kill your programs?

So, say I get disconnected from an SSH-session after I've started rsync or cp or any other command that can be long running. Does that command keep running until it's finished after I get disconnected or does it just get killed? Always wondered…
fregas
  • 1,271
102
votes
2 answers

How can I send a message to the systemd journal from the command line?

In older Linux systems, the logger command can be used to send a log message to syslog. Reading where does logger log its messages to in Arch Linux?, it seems that syslog messages and the logger command line app only talk to the systemd journal if a…
mikemaccana
  • 3,710
99
votes
10 answers

Service start request repeated too quickly, refusing to start limit

I have a systemd service that displays the following error service start request repeated too quickly, refusing to start I understand that the service is configured to restart on failure and it is restarting again and again. But when exactly does…
Vikas Tiwari
  • 1,113
94
votes
3 answers

Modify systemd unit file without altering upstream unit file

I have installed the pimd service by means of apt. This comes with an upstream systemd unit file (/lib/systemd/system/pimd.service). I want the service to be restarted when for some reason it gets killed, hence I wish to add the line Restart =…
giomanda
  • 2,014
78
votes
2 answers

Create a directory under /var/run at boot

I had a daemon that needed its own dir in /var/run for its PID file with write permission granted to the daemon's user. I found I could create this dir with these commands: # mkdir /var/run/mydaemon Then I could change its ownership to the…
user24601
  • 1,043
77
votes
4 answers

failed to get D-Bus connection: Operation not permitted

I'm trying to list services on my CentOS image running in Docker using systemctl list-units but I get this error message: Failed to get D-Bus connection: Operation not permitted Any suggestions what the problem might be?
Snowcrash
  • 1,197
74
votes
4 answers

How to remove missing systemd units?

I'm having trouble figuring out how to remove systemd units that no longer have files. They still seem to linger in the system somehow. The old broken units I am trying to remove: core@ip-172-16-32-83 ~ $ systemctl list-units --all firehose-router* …
Andy Shinn
  • 4,351
72
votes
7 answers

What's the easiest way to make my old init script work in systemd?

I don't want to do the right thing by creating a new systemd script, I just want my old init script to work again now that I've upgraded my system to an OS that's using systemd. I've briefly researched how to convert init scripts and how to write…
mlissner
  • 1,130
67
votes
4 answers

loginctl enable-linger/disable-linger ... but reading linger-status?

I know how to enable/disable lingering with loginctl. But up to now I found no way to query the status of a user. I want to know: Is lingering enable for user foo? How can I access this information?
guettli
  • 3,811
62
votes
2 answers

How do view older journalctl logs (after a rotation maybe?)

I am running docker on ubuntu 16.04 and would like to view the logs. However, I am unable to view logs after what I am guessing is some sort of rotation or the logs grow to a certain size. I have not made any changes to my journald.conf, so I am…
jdf
  • 1,061
1
2 3
99 100