Changes

Jump to navigation Jump to search
Line 73: Line 73:  
   event_link("phplist-create-pseudo", "$event", "55");
 
   event_link("phplist-create-pseudo", "$event", "55");
 
  }
 
  }
 +
 +
 +
* Order of implicit actions
 +
 +
The implicit actions are implemented by inserting the action script generic_template_expand early in the list of actions to be run in an event and the adjust-services action near the end of the list. You should normally link your action scripts in the range S10 to S80 so that they occur after templates2expand and before services2adjust.
 +
 +
{{Note box|The generic_template_expand action is currently run at S05 and services2adjust is run at S90.}}
    
===== service_link_enhanced =====
 
===== service_link_enhanced =====
Line 118: Line 125:     
     templates2events("/opt/roundcube/config/db.inc.php", console-save);
 
     templates2events("/opt/roundcube/config/db.inc.php", console-save);
 +
 +
{{Note box|msg=The settings below are new, waiting a release with the bug [[bugzilla: 8951]]}}
 +
 +
===== event_templates =====
 +
      This function creates a file tree (of empty files) which is used by the generic_template_expand action to determine which templates need to be expanded for a particular event. Takes one event
 +
      argument and a list of file names, e.g.
 +
 +
        event_templates("$event", "/etc/some/file", "/etc/some/file2", "/etc/some/file3", ...);
 +
 +
# templates to expand
 +
for my $event (qw(
 +
conf-wordpress
 +
wordpress-update
 +
))
 +
{
 +
event_templates ($event , "/etc/httpd/conf/httpd.conf");
 +
event_templates ($event , "/etc/dar/DailyBackup.dcf");
 +
}
 +
 +
===== event_actions($event, %actions) =====
 +
      Create links to actions for the given event. %actions is a list of pairs Action => Priority. E.g
 +
 +
        event_actions('myevent', 'action1' => '10', 'action2' => '20', ..);
 +
 +
      See also event_link().
 +
 +
# actions to perform
 +
for my $event (qw(
 +
bootstrap-console-save
 +
console-save
 +
conf-wordpress
 +
wordpress-update
 +
))
 +
{
 +
event_actions ( $event , 'wordpress' => '20', 'wordpressa' => '30' , 'wordpressb' => '40');
 +
}
 +
===== event_services($event, %services) =====
 +
      Create links for the given $event in services2adjust/ subdirectory. %services is a list of pairs Service => LinkDestination
 +
          event_services(’myevent’, ’sshd’ => ’restart’, ’samba’ => ’reload’) See also safe_symlink().
 +
 +
# services to launch on event
 +
for my $event (qw(
 +
conf-wordpress
 +
wordpress-update
 +
))
 +
{
 +
event_services ( $event , "httpd-e-smith"=> 'sigusr1');
 +
event_services ( $event , "mysql.init"=> 'restart');
 +
}
    
==== AUTHOR ====
 
==== AUTHOR ====

Navigation menu