1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 12_ebox_init.dpatch by Javier Uruen Val <javi@warp.es>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Backport 0.11.100 patch to use
6
## DP: /lib/lsb/init-functions to log start/stop actions
10
Index: ebox/tools/ebox
11
===================================================================
12
--- ebox/tools/ebox (revisión: 9763)
13
+++ ebox/tools/ebox (copia de trabajo)
18
+ # Do not restart apache if we are run under ebox-software
19
+ if ($actionName eq 'restart' and $modname eq 'apache' ) {
20
+ return if (exists $ENV{'EBOX_SOFTWARE'} and $ENV{'EBOX_SOFTWARE'} == 1 );
23
if ($actionName eq 'start' and $modname eq 'network' and $mod->isEnabled()) {
25
EBox::Sudo::root("/etc/init.d/networking stop");
33
catch EBox::Exceptions::Base with {
37
$errorMsg = $ex->text;
44
+sub _logActionFunction
46
+ my ($action, $success) = @_;
47
+ system(". /lib/lsb/init-functions; " .
48
+ " log_begin_msg \"$action\"; log_end_msg $success");
53
sub printModuleMessage
55
my ($modname, $action, $success, $errorMsg) = @_;
57
+ my %actions = ( 'start' => 'Starting', 'stop' => 'Stopping',
58
+ 'restart' => 'Restarting' );
60
- my $successMsg = $success ? ' [ OK ]' : '[ ERROR ]';
62
- print STDOUT "EBox: $action $modname:\t\t\t$successMsg\n";
64
+ my $msg = $actions{$action} . " eBox module: $modname";
65
+ _logActionFunction($msg, $success);
67
print STDERR $errorMsg, "\n";