]> git.proxmox.com Git - pmg-api.git/blobdiff - debian/postinst
node: journal: minor code cleanup
[pmg-api.git] / debian / postinst
index 1637d18e8edf6d6f930ba6d011a963c84eebeea1..ae8d2759ec364322cc9f9e3dfdb665fb2229bc80 100644 (file)
@@ -20,9 +20,7 @@ case "$1" in
 
     configure)
 
-       if test -e /proxmox_install_mode ; then
-           # do nothing in test mode here, but setup services in #DEBHELPER# below
-       else
+       if test ! -e /proxmox_install_mode ; then
 
            pmgconfig init
            pmgdb init
@@ -31,7 +29,7 @@ case "$1" in
                pmgconfig sync
            else
                if systemctl --quiet is-active pmgpolicy.service ; then
-                   deb-systemd-invoke reload-or-try-restart postgres.service
+                   deb-systemd-invoke reload-or-try-restart postgresql.service
                fi
                pmgconfig sync --restart
            fi
@@ -39,6 +37,9 @@ case "$1" in
            pmgdb update  >/dev/null 2>&1 &
 
            update-mime-database /usr/share/mime
+       else
+           # rewrite banner
+           pmgbanner || true
        fi
     ;;
 
@@ -56,4 +57,17 @@ esac
 
 #DEBHELPER#
 
+if test ! -e /proxmox_install_mode ; then
+    for service in pmgdaemon pmgproxy; do
+       if [ -n "$2" ]; then
+           # Note: reload-or-try-restart fails if service is not active
+           if systemctl --quiet is-active $service.service ; then
+               deb-systemd-invoke reload-or-try-restart $service.service
+           fi
+       else
+           deb-systemd-invoke start $service.service
+       fi
+    done
+fi
+
 exit 0