Skip to content

Fix systemd units hardcode

nordugrid-arc-bot requested to merge andrii/arc:fix-systemd-units-hardcode into next

Begin arcbot message
This merge request is automatically copied from !768 (merged) orginally made by @andrii
End arcbot message

After series of tries the following fixes are applied to Systemd Unit for ARC.

  • all Units: get improved errors reporting using systemd-notify --status reporting. E.g. in case of configuration validation failed the reason of failed unit start immediately visible in "Status:" string:
KNU:CLUSTER:arc6 [root arc]# systemctl status arc-arex.service 
● arc-arex.service - ARC grid manager
   Loaded: loaded (/etc/systemd/system/arc-arex.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-05-13 10:14:29 EEST; 5s ago
  Process: 6313 ExecStart=/usr/share/arc/arc-arex-start (code=exited, status=1/FAILURE)
 Main PID: 6313 (code=exited, status=1/FAILURE)
   Status: "Error: Configuration validation failed"
  • arc-gridftpd, arc-arex and arc-datadelivery-service - unit invokes start scripts passing foregroud flag to gridftpd and arched respectively. This makes the run natively systemd-friendly instead of forking usage and PIDFiles are not needed at all (however is still written for possible third-partly usage)
  • arc-inifosys-ldap-slapd - PIDFile removed and added exec to ensure first forked process is MAINPID. In this case systemd autodetection works correctly in all cases and not necessary to hardcode the path.
  • arc-inifosys-ldap - bdii update command (including switch user) moved to the dedicated helper script that is generated in create-bdii-config the same way it was done for arc-inifosys-ldap-slapd before this changeset, so now it is even more consistent. PID detection works the same way as for arc-inifosys-ldap-slapd. Helper script path in /var/run is hardcoded so changing infosys_run_dir will not break the start.
  • acix scripts are left as is, because of hardcoded not configurable PID files. In the future it can be improved.

*NOTE: slapd and bdii-update has no support for systemd-friendly foreground mode unfortunately.

*WARNING: helper script creation in create-bdii-config affect SystemV start also. Should be no problems, but worth to re-check on EL6 or similar.

P.S. This changeset fixes BUGZ-3821 and other related issues reported on the chat.

Merge request reports

Loading