/etc/init.d/zentyal is in zentyal-core 2.3.4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | #!/usr/bin/perl
### BEGIN INIT INFO
# Provides: zentyal
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Zentyal (Small Business Server)
### END INIT INFO
use strict;
use warnings;
use EBox;
use EBox::Util::Init;
EBox::init();
$SIG{PIPE} = 'IGNORE';
sub usage {
print "Usage: $0 start|stop|restart\n";
print " $0 <module> start|stop|status|enabled|restart\n";
exit 1;
}
sub main
{
if (@ARGV == 1) {
if ($ARGV[0] eq 'start') {
EBox::Util::Init::start();
}
elsif ($ARGV[0] eq 'restart') {
EBox::Util::Init::stop();
EBox::Util::Init::start();
}
elsif ($ARGV[0] eq 'force-reload') {
EBox::Util::Init::stop();
EBox::Util::Init::start();
}
elsif ($ARGV[0] eq 'stop') {
EBox::Util::Init::stop();
} else {
usage();
}
}
elsif (@ARGV == 2) {
# action upon one module mode
my ($modName, $action) = @ARGV;
if (($action eq 'restart') or ($action eq 'start')) {
EBox::Util::Init::moduleRestart($modName);
}
elsif ($action eq 'stop') {
EBox::Util::Init::moduleStop($modName);
} elsif ($action eq 'status' or $action eq 'enabled') {
# FIXME: Separate enabled and status actions
EBox::Util::Init::status($modName);
} else {
usage();
}
} else {
usage();
}
}
main();
1;
|