initial commit of file from CVS for e-smith-base on Thu 26 Oct 11:24:52 BST 2023
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
{
|
||||
use esmith::I18N;
|
||||
use Locale::gettext;
|
||||
|
||||
my $i18n = new esmith::I18N;
|
||||
$i18n->setLocale('mdEvent.tmpl');
|
||||
|
||||
my $domain = $conf->get_value("DomainName") || "localhost";
|
||||
my $systemName = $conf->get_value("SystemName") || "SME Server";
|
||||
|
||||
$OUT .= "To: $user\n";
|
||||
$OUT .= "From: \"". gettext("mdadm monitoring") . "\" <root\@${domain}>\n";
|
||||
$OUT .= "Subject: " . gettext("$event event on") . " ${device}:${systemName}.${domain}\n\n";
|
||||
|
||||
$OUT .= gettext("This is an automatically generated mail message from mdadm running on").
|
||||
" ${systemName}.${domain}.\n\n";
|
||||
|
||||
$OUT .= gettext("A $event event has been detected on md device").
|
||||
" ${device}.\n\n";
|
||||
|
||||
$OUT .= gettext("Device") . " $member ". gettext("is now an active member of md device") .
|
||||
" ${device}.\n" if $member;
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
[Unit]
|
||||
PartOf=network.service
|
||||
|
@@ -0,0 +1,21 @@
|
||||
{
|
||||
$interface=$InternalInterface{'Name'}||"hum";
|
||||
$configfile='/etc/dhcpd.conf';
|
||||
$leasefile='/var/lib/dhcpd/dhcpd.leases';
|
||||
|
||||
$OUT .="";
|
||||
}
|
||||
[Service]
|
||||
Type=notify
|
||||
ExecStartPre=/sbin/e-smith/service-status dhcpd
|
||||
ExecStartPre=/sbin/e-smith/expand-template {$configfile}
|
||||
ExecStartPre=/bin/touch {$leasefile}
|
||||
#first empty one is to delete original one, as ExecStart allow multiple entries
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/sh -c 'exec /usr/sbin/dhcpd -f -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases -user dhcpd -group dhcpd --no-pid {$interface} >>/var/log/dhcpd/current 2>>/var/log/dhcpd/current'
|
||||
#for systemd >=240
|
||||
#StandardOutput=append:/var/log/dhcpd/current
|
||||
#StandardError=inherit
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
|
@@ -0,0 +1,3 @@
|
||||
[Install]
|
||||
WantedBy=sme-server.target
|
||||
|
@@ -0,0 +1,22 @@
|
||||
[Unit]
|
||||
Wants={
|
||||
|
||||
foreach my $service ($c->get_all_by_prop(type => 'service')){
|
||||
my $status = $service->prop('status') || 'enabled';
|
||||
my $servicename = $service->prop('SystemdUnit') || $service->key . ".service" || "";
|
||||
next unless $servicename || $servicename eq ".service";
|
||||
$status = ($status eq "enabled") ? "enable" : "disable";
|
||||
unless ( $service->key ~~ @list ) {
|
||||
$status = "disable" if -e "/etc/rc.d/init.d/".$service->key || -e "/etc/rc.d/init.d/supervise/".$service->key;
|
||||
}
|
||||
next unless -e "/usr/lib/systemd/system/$servicename" || -e "/etc/lib/systemd/system/$servicename";
|
||||
# bootstrap-console is wantedby basic.target
|
||||
next if ($servicename eq "bootstrap-console.service");
|
||||
# we could also filter out there services that have already WantedBy=.*sme-server.target in their unit file or in a drop-in
|
||||
|
||||
$OUT .= "$servicename " if ($status eq "enable");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user