#50424 Issue 50365 - PIDFile= references path below legacy directory /var/run/
Closed 3 years ago by spichugi. Opened 4 years ago by mhonek.
mhonek/389-ds-base systemd--var-run-2-run  into  master

@@ -9,7 +9,7 @@ 

  

  [Service]

  Type=forking

- PIDFile=@localstatedir@/run/ldap-agent.pid

+ PIDFile=/run/ldap-agent.pid

  ExecStart=@sbindir@/ldap-agent @configdir@/ldap-agent.conf 

  

  [Install]

@@ -12,9 +12,9 @@ 

  NotifyAccess=all

  EnvironmentFile=-@initconfigdir@/@package_name@

  EnvironmentFile=-@initconfigdir@/@package_name@-%i

- PIDFile=@localstatedir@/run/@package_name@/slapd-%i.pid

+ PIDFile=/run/@package_name@/slapd-%i.pid

  ExecStartPre=@libexecdir@/ds_systemd_ask_password_acl @instconfigdir@/slapd-%i/dse.ldif

- ExecStart=@sbindir@/ns-slapd -D @instconfigdir@/slapd-%i -i @localstatedir@/run/@package_name@/slapd-%i.pid

+ ExecStart=@sbindir@/ns-slapd -D @instconfigdir@/slapd-%i -i /run/@package_name@/slapd-%i.pid

  

  [Install]

  WantedBy=multi-user.target

@@ -5,7 +5,7 @@ 

  

  [Service]

  # We can't symbolize here, as llvm symbolize crashes when it goes near systemd.

- Environment=ASAN_OPTIONS=log_path=@localstatedir@/run/@package_name@/ns-slapd-%i.asan:print_stacktrace=1

- Environment=TSAN_OPTIONS=log_path=@localstatedir@/run/@package_name@/ns-slapd-%i.tsan:print_stacktrace=1:second_deadlock_stack=1:history_size=7

- Environment=MSAN_OPTIONS=log_path=@localstatedir@/run/@package_name@/ns-slapd-%i.msan:print_stacktrace=1

- Environment=UBSAN_OPTIONS=log_path=@localstatedir@/run/@package_name@/ns-slapd-%i.ubsan:print_stacktrace=1

+ Environment=ASAN_OPTIONS=log_path=/run/@package_name@/ns-slapd-%i.asan:print_stacktrace=1

+ Environment=TSAN_OPTIONS=log_path=/run/@package_name@/ns-slapd-%i.tsan:print_stacktrace=1:second_deadlock_stack=1:history_size=7

+ Environment=MSAN_OPTIONS=log_path=/run/@package_name@/ns-slapd-%i.msan:print_stacktrace=1

+ Environment=UBSAN_OPTIONS=log_path=/run/@package_name@/ns-slapd-%i.ubsan:print_stacktrace=1

Bug description:
SystemD complains the PIDFile= in the .service file points into a legacy
directory /var/run

Fix description:
Drop '@localstatedir@' which interpolates to '/var'. Although the actual
directory referenced everywhere else is the one prefixed with '/var' it
should not pose a problem since every environment SystemD is supposed to
run in has to have absolute path `/run' present which is effectively
always linked to the legacy '/var/run'.

Fixes https://pagure.io/389-ds-base/issue/50365

Author: Matus Honek mhonek@redhat.com

Review by: ???

What is the impact of this on PREFIX builds? Or other platforms that install under /opt (or whatever)? Just want to make sure we don't break anybody with this change.

Shouldn't we update ldap/admin/src/defaults.inf.in as well?

Shouldn't we update ldap/admin/src/defaults.inf.in as well?

This seems to work fine without update, since /run is symlinked to /var/run.

@vashirov Thanks for checking. I'd keep the defaults.inf as before then.

@mreynolds As we discussed, it is not likely one gets to have a systemd compiled in a way that would allow for loading services' files from locations different from this default. Also, as Thierry and Ludwig confirmed, when they do the prefix builds they actually don't use the systemd services for running the server, as that would not work anyway.

I believe we're green here. If no one objects then I would merge this soon.

I think we'll find out once it's merged if anything goes wrong, the scream test is always effective. All good from me :)

rebased onto c96ef35

4 years ago

Pull-Request has been merged by mhonek

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3482

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago