[389-devel] Regarding changing instance specific scripts to be "global/generic"

Mark Reynolds mareynol at redhat.com
Mon Feb 4 18:39:46 UTC 2013



On 02/04/2013 12:16 PM, Rich Megginson wrote:
> On 02/04/2013 09:42 AM, Mark Reynolds wrote:
>> There has been a request to remove instance specific scripts, and 
>> make them generic and placed in /usr/sbin/
>>
>> https://fedorahosted.org/389/ticket/528
>>
>>
>> Should we remove all the scripts from /usr/lib64/dirsrv/slapd-INSTANCE:
>>
>> bak2db          db2index     dn2rdn ldif2ldap            
>> ns-newpwpolicy.pl  start-slapd usn-tombstone-cleanup.pl
>> bak2db.pl       db2index.pl  fixup-linkedattrs.pl 
>> monitor              restart-slapd      stop-slapd verify-db.pl
>> cleanallruv.pl  db2ldif      fixup-memberof.pl ns-accountstatus.pl  
>> restoreconfig      suffix2instance vlvindex
>> db2bak          db2ldif.pl   ldif2db ns-activate.pl       
>> saveconfig         syntax-validate.pl
>> db2bak.pl       dbverify     ldif2db.pl ns-inactivate.pl     
>> schema-reload.pl   upgradednformat
>>
>> It appears almost of these are all instance specific.  Do we want to 
>> make all of these "generic" and stick them in /usr/sbin?
>
> Yes.
Works for me.
>>
>> However, I think it makes sense to keep some instance specific 
>> scripts: monitor, stop/start/restart, maybe the "task" scripts too 
>> (like schema reload, cleanallruv, fix-memberof, etc).  Then only make 
>> the database scripts generic: db2ldif db2index, ldif2db, db2bak, 
>> bak2db, etc.
>
> One of the goals is to get any "dynamic" files out of /usr.  Most 
> installations want to mount /usr read-only.  They do not want to mount 
> /usr read-write in order to create or update a 389 instance.
>
> IPA works around this by putting the instance specific scripts in 
> /var/lib/dirsrv/scripts-INSTANCE - but most people aren't looking for 
> 389 maintenance commands under /var.
>
> I don't think we need any instance specific scripts, but if we do, 
> they should not be in /usr or /var.
Ok,  I don't think we need them, but if someone really wants them, they 
could go in a new directory under /etc/dirsrv/*
>
> We have already started to do this with the 
> start-dirsrv/stop-dirsrv/restart-dirsrv scripts in /usr/sbin.  With no 
> argument, they work on all instances, or accept the instance name as 
> an argument.  This is fine for start/stop/restart, but might be a bit 
> surprising for something like db2ldif, if it then does an export of 
> all instances.  For all scripts other than start/stop/restart, I think 
> the command should fail if the instance is not specified e.g.
> # db2ldif ...
> Error: More than one instance - specify the instance name as one of: 
> foo bar ...other instance names...
One request was to check if there is only a single instance and then use 
that one by default, otherwise error out.  I think this makes sense, and 
should be easy to do.
>
> The other nice thing about the start-dirsrv etc. scripts is that they 
> use the instance information from /etc/sysconfig/dirsrv-* to look for 
> the dse.ldif, log files, etc.  That removes the need for an instance 
> specific script created during instance creation time with "hardcoded" 
> instance specific values.
Yup, sounds like a plan.

Thanks for your input Rich!

Mark
>
>
>> Just curious what everyone thinks about this.
>>
>> Thanks,
>> Mark
>>
>

-- 
Mark Reynolds
Red Hat, Inc
mreynolds at redhat.com



More information about the 389-devel mailing list