By default a DS instance will run as nobody which has no home directory. Since the user is not root, the initconfig script will be created under $HOME/.dirsrv. Since for nobody the $HOME will be empty, the initconfig will be created in /.dirsrv. When the $HOME is empty the initconfig directory should be /etc/sysconfig.
Created attachment 409946 [details] 0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch Under certain conditions the USER and HOME environment variables could be empty, which may lead to incorrect initconfig directory. The code has been modified to use the effective UID instead of username for better reliability.
This is related to bug #538525.
Comment on attachment 409946 [details] 0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch The perl scripts look good. For the shell scripts - I don't think $EUID is portable. Is it really a problem that $USER is not defined? If so, then we need to use a more portable way e.g. use the "id" command or something like that.
Created attachment 410550 [details] 0001-Bug-586992-Incorrect-initconfig-directory-if-user-ha.patch The patch has been modified so that the shell scripts check for empty USER variable instead of using EUID.
Upstream ticket: https://fedorahosted.org/389/ticket/88
Fixed in 389-ds-base-1.2.10.rc1 now in Fedora/EPEL Testing