initial commit of file from CVS for e-smith-base on Thu 26 Oct 11:24:52 BST 2023

This commit is contained in:
2023-10-26 11:24:52 +01:00
parent bbc22988a8
commit 9510d1a360
678 changed files with 22721 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
[Unit]
PartOf=network.service

View File

@@ -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

View File

@@ -0,0 +1,3 @@
[Install]
WantedBy=sme-server.target

View File

@@ -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");
}
}