Skip to content

Commit

Permalink
place systemd units in /usr/lib/systemd/system
Browse files Browse the repository at this point in the history
Using /usr/lib/systemd/system allows local sysadmins to overwrite to unit file
by placing one of the same name in /etc/systemd/system.

Fixes: kardianos#259
  • Loading branch information
behrmann committed Jun 10, 2021
1 parent 8eb6809 commit e8fc22a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion service_systemd_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func (s *systemd) Platform() string {

func (s *systemd) configPath() (cp string, err error) {
if !s.isUserService() {
cp = "/etc/systemd/system/" + s.unitName()
// /usr/lib/systemd/system is the lowest priority directory in the
// unit search path
cp = "/usr/lib/systemd/system/" + s.unitName()
return
}
homeDir, err := os.UserHomeDir()
Expand Down

0 comments on commit e8fc22a

Please sign in to comment.