Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 224606

Summary: Instance specific dirs should be in instance directory
Product: [Retired] 389 Reporter: Rich Megginson <rmeggins>
Component: Install/UninstallAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0.4CC: nkinder
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 17:14:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 427409    
Attachments:
Description Flags
diffs to create additional instance dirs none

Description Rich Megginson 2007-01-26 17:43:52 UTC
In order to "fedora-ize" the file/dir layout, the instance specific directory
should always be a child of the product name directory.  This means the
following directories will be moved:
/var/lock/slapd-instance -> /var/lock/fedora-ds/slapd-instance
/var/lib/slapd-instance -> /var/lib/fedora-ds/slapd-instance
/var/log/slapd-instance -> /var/log/fedora-ds/slapd-instance
/var/run/slapd-instance -> /var/run/fedora-ds
the last one is a special case.  fedora prefers the pid files to be named
name.pid e.g. slapd-instance.pid rather than have a subdir with a file called
pid.  This also means some additional code in order to make /var/run/fedora-ds
secure yet still writable by the server userid (e.g. nobody:nobody).

Comment 1 Rich Megginson 2007-01-26 17:45:14 UTC
Created attachment 146695 [details]
diffs to create additional instance dirs

Comment 2 Noriko Hosoi 2007-01-26 19:30:31 UTC
Looks good.

Comment 3 Rich Megginson 2007-01-26 20:01:36 UTC
Reviewed by: nhosoi (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Fixed create instance to create these instance specific
directories:
/var/lock/slapd-instance -> /var/lock/fedora-ds/slapd-instance
/var/lib/slapd-instance -> /var/lib/fedora-ds/slapd-instance
/var/log/slapd-instance -> /var/log/fedora-ds/slapd-instance
/var/run/slapd-instance -> /var/run/fedora-ds
For now, I'm side-stepping the question of what to do about permissions on
/var/run/fedora-ds/slapd-instance.pid - we'll address this in the RPM creation.
I've also moved the migration scripts to the %{_libdir}/fedora-ds/slapd-instance
directory, and I've made the default directory for the key/cert db the same as
the config directory.  I think the dynamic nature of their configuration
warrants the move.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no 

Checking in ldapserver/ldap/admin/lib/dsalib_updown.c;
/cvs/dirsec/ldapserver/ldap/admin/lib/dsalib_updown.c,v  <--  dsalib_updown.c
new revision: 1.9; previous revision: 1.8
done
Checking in ldapserver/ldap/admin/src/create_instance.c;
/cvs/dirsec/ldapserver/ldap/admin/src/create_instance.c,v  <--  create_instance.c
new revision: 1.41; previous revision: 1.40
done
Checking in ldapserver/ldap/admin/src/scripts/template-start-slapd.in;
/cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-start-slapd.in,v  <-- 
template-start-slapd.in
new revision: 1.4; previous revision: 1.3
done
Checking in ldapserver/ldap/admin/src/scripts/template-stop-slapd.in;
/cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-stop-slapd.in,v  <-- 
template-stop-slapd.in
new revision: 1.4; previous revision: 1.3
done


Comment 4 Noriko Hosoi 2007-01-29 23:57:52 UTC
In the diffs of Comment #1, 
Index: ldapserver/ldap/admin/lib/dsalib_updown.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/lib/dsalib_updown.c,v
retrieving revision 1.8
diff -u -8 -r1.8 dsalib_updown.c
--- ldapserver/ldap/admin/lib/dsalib_updown.c	10 Nov 2006 23:44:32 -0000	1.8
+++ ldapserver/ldap/admin/lib/dsalib_updown.c	26 Jan 2007 17:40:14 -0000
@@ -90,17 +90,17 @@
[...]
-    PR_snprintf(pid_file_name, BIG_LINE, "%s/pid", rundir);
+    PR_snprintf(pid_file_name, BIG_LINE, "%s/%s.pid", ds_get_server_name(),
rundir);
[...]

You actually meant this, didn't you? ;)
+    PR_snprintf(pid_file_name, BIG_LINE, "%s/%s.pid", rundir,
ds_get_server_name());

With the above change, I could make quickinstall PASS again.
Test Name            PASS       FAIL     NORESULT
quickinstall startup 100% (1/1) 	  	 

Comment 5 Rich Megginson 2007-01-30 00:08:36 UTC
Yep.  Thanks Noriko!

Checking in dsalib_updown.c;
/cvs/dirsec/ldapserver/ldap/admin/lib/dsalib_updown.c,v  <--  dsalib_updown.c
new revision: 1.10; previous revision: 1.9
done