cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Starfighter Starfighter
Starfighter
  • 1,307 Views

Systemd Unit Files

Jump to solution

Systemd unit files exist in multiple directories.  Which of these
directories has precedence?

Trevor "Red Hat Evangelist" Chandler
1 Solution

Accepted Solutions
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 1,218 Views

So the order of precedence is:

  1. /etc/systemd/system/
  2. /run/systemd/system
  3. /usr/lib/systemd/system/

I remember them in this order becasue they're alphabetical. /etc, then /run, then /usr/lib

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College

View solution in original post

6 Replies
TM
Flight Engineer Flight Engineer
Flight Engineer
  • 1,289 Views

According to man 5 systemd.unit, they are as below from hugher to lower precedence.

/etc/systemd/system.control
/run/systemd/system.control
/run/systemd/transient
/run/systemd/generator.early
/etc/systemd/system
/run/systemd/system
/run/systemd/generator
/usr/local/lib/systemd/system
/usr/lib/systemd/system
/run/systemd/generator.late

Trevor
Starfighter Starfighter
Starfighter
  • 1,238 Views

There's no more definitive response than one from a manpage!!!

Great response TM!!!

Trevor "Red Hat Evangelist" Chandler
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,230 Views

The configuration files from the /etc/systemd/system/ configuration directories take precedence over unit files in /usr/lib/systemd/system/  and  the run time files at /run/systemd/system has a precedence higher than the /usr one but less than the /etc ones.

 

Chetan_Tiwary__1-1729542141235.png

 

Tracy_Baker
Starfighter Starfighter
Starfighter
  • 1,219 Views

So the order of precedence is:

  1. /etc/systemd/system/
  2. /run/systemd/system
  3. /usr/lib/systemd/system/

I remember them in this order becasue they're alphabetical. /etc, then /run, then /usr/lib

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Trevor
Starfighter Starfighter
Starfighter
  • 1,206 Views

Never thought about looking in an alphabetical order.
That's a big help!

Thanks Tracy!!!

Trevor "Red Hat Evangelist" Chandler
Trevor
Starfighter Starfighter
Starfighter
  • 1,206 Views

Loving this! 

Thanks Chetan!!!

Trevor "Red Hat Evangelist" Chandler
Join the discussion
You must log in to join this conversation.