mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/1Panel-dev/1Panel.git
synced 2026-09-20 08:03:55 +08:00
fix: Fix the issue of abnormal sshd service auto-start status (#11022)
Refs #11017
This commit is contained in:
@@ -26,10 +26,10 @@ func (s *Systemd) IsActive(serviceName string) (bool, error) {
|
||||
|
||||
func (s *Systemd) IsEnable(serviceName string) (bool, error) {
|
||||
out, err := run(s.toolCmd, "is-enabled", serviceName)
|
||||
if out == "alias\n" && serviceName == "sshd.service" {
|
||||
return s.IsEnable("ssh")
|
||||
}
|
||||
if err != nil && out != "disabled\n" {
|
||||
if serviceName == "sshd" && out == "alias\n" {
|
||||
return s.IsEnable("ssh")
|
||||
}
|
||||
if NewSnap().IsEnable(serviceName) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user