In lib389/instances/setup.py the _install_ds method of class SetupDs uses sysconf_dir with hardcoded path sysconfig instead of initconfig_dir. This breaks the script if initconfig_dir is not equal to /etc/sysconfig, e.g. /etc/default.
lib389/instances/setup.py
_install_ds
SetupDs
sysconf_dir
sysconfig
initconfig_dir
/etc/sysconfig
/etc/default
A patch fixing the problem is attached below.
Version: 1.4.0.18 Platfrom: Linux (Debian)
/etc/$PACKAGE_NAME/config
dscreate
Installation fails due to assert condition ds_instance.exists() in method _install_ds of class SetupDs, because ds_instance.list() returning an empty list since sysconfig_head searches for files in /etc/default but the files it is looking for reside in /etc/sysconfig
ds_instance.exists()
ds_instance.list()
sysconfig_head
Instance installation works with files installed in directory /etc/default and successful assertion.
diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py index 9335613da..9276f1732 100644 --- a/src/lib389/lib389/instance/setup.py +++ b/src/lib389/lib389/instance/setup.py @@ -593,10 +593,10 @@ class SetupDs(object): for line in template_init.readlines(): initconfig += line.replace('{{', '{', 1).replace('}}', '}', 1).replace('-', '_') try: - os.makedirs("%s/sysconfig" % slapd['sysconf_dir'], mode=0o775) + os.makedirs("%s" % slapd['initconfig_dir'], mode=0o775) except FileExistsError: pass - with open("%s/sysconfig/dirsrv-%s" % (slapd['sysconf_dir'], slapd['instance_name']), 'w') as f: + with open("%s/dirsrv-%s" % (slapd['initconfig_dir'], slapd['instance_name']), 'w') as f: f.write(initconfig.format( SERVER_DIR=slapd['lib_dir'], SERVERBIN_DIR=slapd['sbin_dir'],
Do we have initconfig_dir in defaults.inf? I think that's something we'll need for this patch to really work. @spichugi Can you follow up with this?
Metadata Update from @firstyear: - Custom field component adjusted to None - Custom field origin adjusted to None - Custom field reviewstatus adjusted to None - Custom field type adjusted to None - Custom field version adjusted to None
Is there an update to this topic?
@janluca Not yet sadly. :( @spichugi can you comment on this?
Looks like we have it. I'll prepare the PR and we can tested on RHEL 7 too (shouldn't be a problem though)
https://pagure.io/389-ds-base/pull-request/50033
Metadata Update from @spichugi: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
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 issue has been cloned to Github and is available here: - https://github.com/389ds/389-ds-base/issues/3033
If you want to receive further updates on the issue, please navigate to the github issue and click on subscribe button.
subscribe
Thank you for understanding. We apologize for all inconvenience.
Metadata Update from @spichugi: - Issue close_status updated to: wontfix (was: fixed)
Login to comment on this ticket.