Code

Add option to execute custom scripts after LDAP config file generation (#4125).
authorlhm-gosa <lhm-gosa@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Feb 2010 13:00:50 +0000 (13:00 +0000)
committerlhm-gosa <lhm-gosa@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Feb 2010 13:00:50 +0000 (13:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15601 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-si/client/events/corefunctions.pm

index d75c1006bf554ab00cf4a2b9973dc6b7c9ecc4ef..e640c87a756f2d82e082519470f167ea95c4e7b0 100644 (file)
@@ -23,7 +23,7 @@ use Fcntl;
 use GOSA::GosaSupportDaemon;
 use File::Basename;
 
-my ($ldap_enabled, $offline_enabled, $ldap_config, $pam_config, $nss_config, $fai_logpath);
+my ($ldap_enabled, $offline_enabled, $ldap_config, $pam_config, $nss_config, $fai_logpath, $ldap_config_exit_hook);
 
 my $chrony_file = "/etc/chrony/chrony.conf";
 my $syslog_file = "/etc/syslog.conf";
@@ -36,6 +36,7 @@ my %cfg_defaults = (
         "pam-config" => [\$pam_config, "/etc/pam_ldap.conf"],
         "nss-config" => [\$nss_config, "/etc/libnss-ldap.conf"],
         "fai-logpath" => [\$fai_logpath, "/var/log/fai/fai.log"],
+        "ldap-config-exit-hook" => [\$ldap_config_exit_hook, undef],
     },
 );
 
@@ -448,6 +449,12 @@ sub new_ldap_config {
     chown(0, 0, $cfg_name);
     chmod(0644, $cfg_name);
 
+    # Allow custom scripts to be executed
+    if (defined $ldap_config_exit_hook) {
+        system($ldap_config_exit_hook);
+        daemon_log("executed hook $ldap_config_exit_hook", 5);
+    }
+
     return;
 }