]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Added "hup" trigger.
authorAlan T. DeKok <aland@freeradius.org>
Sun, 29 Apr 2012 13:22:17 +0000 (15:22 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 29 Apr 2012 13:25:03 +0000 (15:25 +0200)
It is sent when this module (and only this module) is sent
a HUP via "radmin"

mibs/FREERADIUS-NOTIFICATION-MIB.txt
raddb/trigger.conf
src/main/command.c

index 888d44ad8369bcd8ef7f2caa2ef38e5474beb8f2..3c8213460d458988d8d512be964c2c8927d8a905 100644 (file)
@@ -92,6 +92,13 @@ serverModuleConnectionFail NOTIFICATION-TYPE
        DESCRIPTION "Notification that the module has failed to open a new connection"
        ::= { serverModuleGeneric 4 }
 
+serverModuleHup NOTIFICATION-TYPE
+       OBJECTS { radiusdModuleName,
+                radiusdModuleInstance }
+       STATUS current
+       DESCRIPTION "Notification that the module has been HUP'd via radmin"
+       ::= { serverModuleGeneric 5 }
+
 homeServer  OBJECT IDENTIFIER ::= { freeRadiusNotificationMib 3 }
 
 --
index 12b9639811efd3745d4582bde860d1c302d6dab0..54746343946d0d4ec92b1e955466349b6cb2c322 100644 (file)
@@ -177,6 +177,18 @@ trigger {
        #  module.  You can have module-specific triggers, by placing a
        #  "trigger" subsection in the module configuration.
        modules {
+               # The files module
+               files {
+                       # Common arguments
+                       args = "radiusdModuleName s ldap' radiusdModuleInstance s ''"
+
+                       # The module has been HUP'd via radmin
+                       hup = "${snmptrap}::serverModuleHup ${args}"
+
+                       # Note that "hup" can be used for every module
+                       # which can be HUP'd via radmin
+               }
+
                # The LDAP module
                ldap {
                        # Common arguments
@@ -224,6 +236,7 @@ trigger {
 # home_server.zombie
 # home_server_pool.fallback
 # home_server_pool.normal
+# modules.*.hup
 # modules.ldap.fail
 # modules.sql.close
 # modules.sql.fail
index 34b1ac031f5af23e8c5ca05037667f6ecb33f633..19485fdbec27fb02e4a902c34084596b6d53e1ed 100644 (file)
@@ -297,6 +297,7 @@ static int command_hup(rad_listen_t *listener, int argc, char *argv[])
 {
        CONF_SECTION *cs;
        module_instance_t *mi;
+       char buffer[256];
 
        if (argc == 0) {
                radius_signal_self(RADIUS_SIGNAL_SELF_HUP);
@@ -323,6 +324,9 @@ static int command_hup(rad_listen_t *listener, int argc, char *argv[])
                return 0;
        }
 
+       snprintf(buffer, sizeof(buffer), "modules.%s.hup", argv[0]);
+       exec_trigger(NULL, mi->cs, buffer);
+
        return 1;               /* success */
 }