|
NAMEregather - LDAP syncrepl consumer script to perform actions desired on syncrepl event.SYNOPSISregather [-h|--help|-? -F] <-c regather.conf> [ -C section.option=value, ... ]DESCRIPTIONregather is a LDAP syncrepl consumer to generate ( re-gather ) files on LDAP syncrepl events or even more, it can perform any action you set (like create/delete directories or other).regather performs all actions through plugins. Plugins currently implemented you can know with option --plugin-list It uses Net::LDAP(3) to do all LDAP related stuff and Template to generate files. Config file is processed with Config::Parser (look CONFIG FILE section bellow) As an example, regather can re-write each OpenVPN client config file on change done to client LDAP configured data, or re-write CRL file on update in LDAP or change sieve script for mail user. regather is configured via it's configuration file. Each configuration option can be set/overidden via CLI options like -C section.subsection.subsubsection.option=value regather connects to LDAP ldap.opt.uri configured and performs search with ldap.srch.filter which has to provide search result for all configured services Search results are used to provide data for plugins. Module Template(3) is used to write target file, using configured core.tt_path/service.XXX.tt_file Net::DNS(3) is used to nsupdate dyn zones. OPERATIONSOn LDAP repl event, consumer receives syncstate, we process these three:
on LDAP_SYNC_ADD and LDAP_SYNC_MODIFY we just overwrite all configured for the service things (files, directories e.t.c.) ModRDN event comes as LDAP_SYNC_MODIFY, and since in DN it has the new RDN, the only way to know the old one (to delete all resources related to it, first) we need search accesslog DB (see slapo-accesslog(5)) for the attribute reqNewRDN=new-RDN LDAP_SYNC_DELETE differs a bit, it can be spawned by deletion of LDAP object itself or by deletion of some attribute of the object. So, on that event we restore previous state of the object from accesslog DB (which is mandatory for our work) and look at the attribute reqType value. There are two cases we take care of:
OPTIONS
EXAMPLESregather -c /some/regather.conf.config-tiny
-C core.altroot=/tmp/regather-altroot.d
-C core.tt_path=/path/regather.d
--colors -f -Fvvv
this does next:
FILES/usr/local/etc/regather.d/*.tt templates to generate files from /usr/local/etc/regather.conf config file /usr/local/etc/openldap/ldap.conf /etc/ldap.conf /etc/ldap/ldap.conf /etc/openldap/ldap.conf CONFIG FILEconfig file format is described in Regather::Config documentation.SIGNALSHUP - restartINT, QUIT, ABRT, TERM - terminate BUGS
SEE ALSONet::LDAP(3), Net::LDAP::Control::SyncRequest(3) Template(3), App::Regather::Config(3) slapo-accesslog(5)AUTHORZeus Panchenko <zeus@gnu.org.ua>COPYRIGHTCopyright 2020 Zeus Panchenko.This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Visit the GSP FreeBSD Man Page Interface. |