summaryrefslogtreecommitdiffstats
path: root/hammer.py
diff options
context:
space:
mode:
authorWlodzimierz Wencel <wlodek@isc.org>2023-09-21 13:23:12 +0200
committerWlodzimierz Wencel <wlodek@isc.org>2023-09-21 13:23:12 +0200
commit8fd13cac14ddca04333fa75c20e1d030e954e17f (patch)
tree300c862be4aa5f235a5c1f483d732558f686f921 /hammer.py
parent[#3002] add examples for SZTP redirect options (diff)
downloadkea-8fd13cac14ddca04333fa75c20e1d030e954e17f.tar.xz
kea-8fd13cac14ddca04333fa75c20e1d030e954e17f.zip
[#3060] fix for centos 7 pkgs, updated deb services names
Diffstat (limited to 'hammer.py')
-rwxr-xr-xhammer.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/hammer.py b/hammer.py
index be265c071b..dfb7659e05 100755
--- a/hammer.py
+++ b/hammer.py
@@ -2322,6 +2322,16 @@ def _build_rpm(system, revision, features, tarball_path, env, check_times, dry_r
execute('sed -i -e s/{FREERADIUS_CLIENT_VERSION}/%s/g %s/SPECS/kea.spec' % (frc_version, rpm_root_path), check_times=check_times, dry_run=dry_run)
+ services_list = ['kea-dhcp4.service', 'kea-dhcp6.service', 'kea-dhcp-ddns.service', 'kea-ctrl-agent.service']
+
+ # centos/rhel 7 does not support some fields in systemd unit files so they need to be commented out
+ if system == 'centos' and revision == '7':
+ for f in services_list:
+ for k in ['RuntimeDirectory', 'RuntimeDirectoryPreserve', 'LogsDirectory', 'LogsDirectoryMode', 'StateDirectory', 'ConfigurationDirectory']:
+ cmd = "sed -i -E 's/^(%s=.*)/#\\1/' %s" % (k, f)
+ execute(cmd, cwd=rpm_dir, check_times=check_times, dry_run=dry_run)
+
+
# do rpm build
cmd = "rpmbuild --define 'kea_version %s' --define 'isc_version %s' -ba %s/SPECS/kea.spec"
cmd += " -D'_topdir %s'"
@@ -2407,7 +2417,7 @@ def _build_deb(system, revision, features, tarball_path, env, check_times, dry_r
execute('sed -i -e s/{ISC_VERSION}/%s/ changelog' % pkg_isc_version, cwd='kea-src/kea-%s/debian' % pkg_version, check_times=check_times, dry_run=dry_run)
execute('sed -i -e s/{FREERADIUS_CLIENT_VERSION}/%s/g control' % frc_version, cwd='kea-src/kea-%s/debian' % pkg_version, check_times=check_times, dry_run=dry_run)
- services_list = ['isc-kea-dhcp4-server.service', 'isc-kea-dhcp6-server.service', 'isc-kea-dhcp-ddns-server.service', 'isc-kea-ctrl-agent.service']
+ services_list = ['isc-kea-dhcp4.isc-kea-dhcp4-server.service', 'isc-kea-dhcp6.isc-kea-dhcp6-server.service', 'isc-kea-dhcp-ddns.isc-kea-dhcp-ddns-server.service', 'isc-kea-ctrl-agent.service']
# debian 9 does not support some fields in systemd unit files so they need to be commented out
if system == 'debian' and revision == '9':
@@ -2426,6 +2436,7 @@ def _build_deb(system, revision, features, tarball_path, env, check_times, dry_r
# install packages
execute('sudo dpkg -i kea-src/*deb', check_times=check_times, dry_run=dry_run)
# check if kea services can be started
+ services_list = ['isc-kea-dhcp4-server.service', 'isc-kea-dhcp6-server.service', 'isc-kea-dhcp-ddns-server.service', 'isc-kea-ctrl-agent.service']
_check_installed_rpm_or_debs(services_list)