fix problem when sv and systemctl exists at the same time in ubuntu, core command related dokku nginx plugin will fail.

This will happend when an ubuntu server upgrade from early version.
This commit is contained in:
renweibo
2023-12-22 23:08:10 +08:00
committed by GitHub
parent e6953d60e9
commit ff2d60003d
2 changed files with 6 additions and 6 deletions

View File

@@ -149,10 +149,10 @@ fn-nginx-vhosts-nginx-init-cmd() {
ubuntu)
# support docker-based installations
if [[ -x /usr/bin/sv ]]; then
sudo /usr/bin/sv "$CMD" "$NGINX_INIT_NAME"
elif [[ -x /usr/bin/systemctl ]]; then
if [[ -x /usr/bin/systemctl ]]; then
sudo /usr/bin/systemctl "$CMD" "$NGINX_INIT_NAME"
elif [[ -x /usr/bin/sv ]]; then
sudo /usr/bin/sv "$CMD" "$NGINX_INIT_NAME"
elif [[ "$CMD" == "enable" ]] || [[ "$CMD" == "disable" ]]; then
dokku_log_warn "Running $CMD is not possible for init.d managed services"
else