fix: detect and use systemd on Debian systems

Debian Bookworm completely removes invoke-rc.d, thus breaking interactions with nginx.

Closes #6020
This commit is contained in:
Jose Diaz-Gonzalez committed 2023-07-11 20:34:50 -04:00
1 parent 30a94d1f9d
commit c44d779695
3 files changed
+12 -6

No files matched your search

+5 -1
View File
@@ -125,7 +125,11 @@ fn-nginx-vhosts-nginx-init-cmd() {
case "$DOKKU_DISTRO" in
debian | raspbian)
sudo /usr/sbin/invoke-rc.d "$NGINX_INIT_NAME" "$CMD"
if [[ -x /usr/bin/systemctl ]]; then
sudo /usr/bin/systemctl "$CMD" "$NGINX_INIT_NAME"
else
sudo /usr/sbin/invoke-rc.d "$NGINX_INIT_NAME" "$CMD"
fi
;;
ubuntu)