Fix systemd units hardcode
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
andarc-datadelivery-service
- unit invokes start scripts passing foregroud flag togridftpd
andarched
respectively. This makes the run natively systemd-friendly instead offorking
usage and PIDFiles are not needed at all (however is still written for possible third-partly usage) -
arc-inifosys-ldap-slapd
- PIDFile removed and addedexec
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 increate-bdii-config
the same way it was done forarc-inifosys-ldap-slapd
before this changeset, so now it is even more consistent. PID detection works the same way as forarc-inifosys-ldap-slapd
. Helper script path in/var/run
is hardcoded so changinginfosys_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.