From 9df995d8df39d81b43f92e18bafae5778762dea1 Mon Sep 17 00:00:00 2001 From: nexustar Date: Mon, 23 May 2022 16:37:03 +0800 Subject: [PATCH] cluster: support RHEL8 --- embed/templates/systemd/system.service.tpl | 2 +- embed/templates/systemd/tispark.service.tpl | 4 ++-- pkg/cluster/operation/check.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/embed/templates/systemd/system.service.tpl b/embed/templates/systemd/system.service.tpl index d4fd62c9ce..3d9966ab13 100644 --- a/embed/templates/systemd/system.service.tpl +++ b/embed/templates/systemd/system.service.tpl @@ -25,7 +25,7 @@ LimitSTACK=10485760 AmbientCapabilities=CAP_NET_RAW {{- end}} User={{.User}} -ExecStart={{.DeployDir}}/scripts/run_{{.ServiceName}}.sh +ExecStart=/bin/bash -c '{{.DeployDir}}/scripts/run_{{.ServiceName}}.sh' {{- if eq .ServiceName "prometheus"}} ExecReload=/bin/bash -c 'kill -HUP $MAINPID $(pidof {{.DeployDir}}/bin/ng-monitoring-server)' {{end}} diff --git a/embed/templates/systemd/tispark.service.tpl b/embed/templates/systemd/tispark.service.tpl index c3545c97bc..843dbdebdb 100644 --- a/embed/templates/systemd/tispark.service.tpl +++ b/embed/templates/systemd/tispark.service.tpl @@ -7,8 +7,8 @@ User={{.User}} {{- if ne .JavaHome ""}} Environment="JAVA_HOME={{.JavaHome}}" {{- end}} -ExecStart={{.DeployDir}}/sbin/start-{{.ServiceName}}.sh -ExecStop={{.DeployDir}}/sbin/stop-{{.ServiceName}}.sh +ExecStart=/bin/bash -c '{{.DeployDir}}/sbin/start-{{.ServiceName}}.sh' +ExecStop=/bin/bash -c '{{.DeployDir}}/sbin/stop-{{.ServiceName}}.sh' Type=forking {{- if .Restart}} Restart={{.Restart}} diff --git a/pkg/cluster/operation/check.go b/pkg/cluster/operation/check.go index 6da90e1493..7aa72cbc2c 100644 --- a/pkg/cluster/operation/check.go +++ b/pkg/cluster/operation/check.go @@ -178,8 +178,8 @@ func checkOSInfo(opt *CheckOptions, osInfo *sysinfo.OS) *CheckResult { // check version // CentOS 8 is known to be not working, and we don't have plan to support it // as of now, we may add support for RHEL 8 based systems in the future. - if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 7 || ver >= 8 { - result.Err = fmt.Errorf("%s %s not supported, use version 7 please", + if ver, _ := strconv.ParseFloat(osInfo.Version, 64); ver < 7 { + result.Err = fmt.Errorf("%s %s not supported, use version 8 please", osInfo.Name, osInfo.Release) return result }