diff options
| author | Rich Megginson <rmeggins@redhat.com> | 2007-02-07 23:57:40 +0000 |
|---|---|---|
| committer | Rich Megginson <rmeggins@redhat.com> | 2007-02-07 23:57:40 +0000 |
| commit | 44ed8bab7f2de4b295a88230a35f66af72a12d18 (patch) | |
| tree | bb57e6674feead6fe0598ddf092141af53591ebe /ldap/admin/src/create_instance.c | |
| parent | 67be3511d41496ed3c26f082cbf1eb06d96003cb (diff) | |
| download | ds-44ed8bab7f2de4b295a88230a35f66af72a12d18.tar.gz ds-44ed8bab7f2de4b295a88230a35f66af72a12d18.tar.xz ds-44ed8bab7f2de4b295a88230a35f66af72a12d18.zip | |
esolves: bug 227618
Bug Description: FHS: move exes to _bindir; move ns-slapd to _sbindir
Reviewed by: many people (Thanks!)
Fix Description: In order to be more FHS compliant, we need to make the following changes:
1) move files executable by end users to _bindir (e.g. /usr/bin) - this means logconv.pl, ds_newinst, dbscan, etc.
2) move the server executable ns-slapd to _sbindir (e.g. /usr/sbin)
And, to be more packaging friendly, the additional changes:
3) move libback-ldbm to the plugins dir - it is a plugin
4) use the libtool -avoid-version flag with plugins - we don't need the .so.0.0.0 for plugins
I had to add support for sbindir and SBINDIR to create_instance and ds_newinst. We were using serverdir for 3 things - command line programs, server specific shared libs, and the server executable itself. These are now in 3 different places. The biggest change was to the scripts. I kept serverdir and SERVER-DIR to be the location of the server shared libs to avoid changing even more stuff. I had to add SERVERBIN-DIR to the scripts - this is the location of ns-slapd and is set by sbindir in create_instance (which defaults to SBINDIR from Makefile.am which defaults to $prefix/sbin in configure - whew).
I've tested instance creation with these diffs - everything seems to work fine.
5) reorder files in alphabetical order - suggested by nkinder
6) add $LDFLAGS to test in db.m4
7) touch all template/wrapper .in files to make them newer than their corresponding files
Platforms tested: RHEL4, FC6
Flag Day: no
Doc impact: Yes, but the docs will have to change quite a bit for all of the FHS related changes.
Diffstat (limited to 'ldap/admin/src/create_instance.c')
| -rw-r--r-- | ldap/admin/src/create_instance.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ldap/admin/src/create_instance.c b/ldap/admin/src/create_instance.c index cdcc3e27..bea8c2ac 100644 --- a/ldap/admin/src/create_instance.c +++ b/ldap/admin/src/create_instance.c @@ -312,6 +312,7 @@ void set_defaults(char *sroot, char *hn, server_config_s *conf) conf->bak_dir = NULL; conf->config_dir = NULL; + conf->sbindir = NULL; conf->datadir = NULL; conf->db_dir = NULL; conf->docdir = NULL; @@ -700,7 +701,7 @@ char *gen_script_auto(char *s_root, char *cs_path, { char myperl[PATH_SIZE]; char fn[PATH_SIZE], ofn[PATH_SIZE]; - const char *table[16][2]; + const char *table[17][2]; if (PR_FAILURE == PR_Access(cs_path, PR_ACCESS_EXISTS)) { printf("Notice: %s does not exist, skipping %s . . .\n", cs_path, name); @@ -756,7 +757,9 @@ char *gen_script_auto(char *s_root, char *cs_path, table[13][1] = cf->run_dir; table[14][0] = "PRODUCT-NAME"; table[14][1] = PRODUCT_NAME; - table[15][0] = table[15][1] = NULL; + table[15][0] = "SERVERBIN-DIR"; + table[15][1] = cf->sbindir; + table[16][0] = table[16][1] = NULL; if (generate_script(ofn, fn, NEWSCRIPT_MODE, table) != 0) { return make_error("Could not write %s to %s (%s).", ofn, fn, @@ -3219,7 +3222,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path) fprintf(f, "objectclass: nsSlapdPlugin\n"); fprintf(f, "objectclass: extensibleObject\n"); fprintf(f, "cn: ldbm database\n"); - fprintf(f, "nsslapd-pluginpath: %s/libback-ldbm%s\n", cf->sroot, shared_lib); + fprintf(f, "nsslapd-pluginpath: %s/libback-ldbm%s\n", cf->plugin_dir, shared_lib); fprintf(f, "nsslapd-plugininitfunc: ldbm_back_init\n"); fprintf(f, "nsslapd-plugintype: database\n"); fprintf(f, "nsslapd-pluginenabled: on\n"); @@ -4229,6 +4232,7 @@ set_path_attribute(char *attr, char *defaultval, char *prefix) * cf->localstatedir: %{_localstatedir} * cf->sysconfdir: %{_sysconfdir} * cf->bindir: %{_bindir} + * cf->sbindir: %{_sbindir} * cf->datadir: %{_datadir} * cf->docdir: %{_docdir} * cf->inst_dir: <sroot>/slapd-<servid> @@ -4461,6 +4465,7 @@ int parse_form(server_config_s *cf) cf->localstatedir = set_path_attribute("localstatedir", LOCALSTATEDIR, prefix); cf->sysconfdir = set_path_attribute("sysconfdir", SYSCONFDIR, prefix); cf->bindir = set_path_attribute("bindir", BINDIR, prefix); + cf->sbindir = set_path_attribute("sbindir", SBINDIR, prefix); cf->datadir = set_path_attribute("datadir", DATADIR, prefix); cf->docdir = set_path_attribute("docdir", DOCDIR, prefix); |
