the name 'pve-manager' collides with our pve-manager package name,
which - from the user point of view - provides mainly the API and
WebUI.
An user could thus think that restarting 'pve-manager' would restart
the WebUIs server, which is relatable.
But, the pve-manager.service does not controls the WebUI or its
server but is responsible for starting all guest with 'onboot=1' in
their config on system boot and to stop all remaining running guests
on system shutdown.

Thus rename it to pve-guests and adapt its description. This may not
seem as ideal name at first glance, but its better than the current
option. Further it leads to log messages like:
 > Starting PVE guests (Service providing start-on-boot and 
 > stop-all-on-shutdown)
 > [...]
 > Started PVE guests (Service providing start-on-boot and stop-all-on-shutdown)
 > [...]
 > Stopping PVE guests (Service providing start-on-boot and 
 > stop-all-on-shutdown)

which makes it clearer what happens, or what this service is for.

Alias the new service to the old pve-manager.service for legacy
reasons. While our services do not depend on it an user could have
made an own service which used pve-manager.service as synchronisation
point.

Linitian then complains about init.d/pve-manager not having a related
systemd service file. Instead of renmaning it just drop it.

Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com>
---

 bin/init.d/Makefile                                |  3 +-
 .../{pve-manager.service => pve-guests.service}    |  5 ++-
 bin/init.d/pve-manager                             | 51 ----------------------
 debian/postinst                                    |  3 +-
 debian/postrm                                      |  2 +-
 5 files changed, 7 insertions(+), 57 deletions(-)
 rename bin/init.d/{pve-manager.service => pve-guests.service} (81%)
 delete mode 100755 bin/init.d/pve-manager

diff --git a/bin/init.d/Makefile b/bin/init.d/Makefile
index 99ca432d..bd1445d2 100644
--- a/bin/init.d/Makefile
+++ b/bin/init.d/Makefile
@@ -3,7 +3,6 @@ include ../../defines.mk
 all:
 
 SCRIPTS =              \
-       pve-manager     \
        pvedaemon       \
        pveproxy        \
        spiceproxy      \
@@ -14,7 +13,7 @@ SERVICES=                     \
        pvebanner.service       \
        pvenetcommit.service    \
        pvestatd.service        \
-       pve-manager.service     \
+       pve-guests.service      \
        pvedaemon.service       \
        pveproxy.service        \
        spiceproxy.service      \
diff --git a/bin/init.d/pve-manager.service b/bin/init.d/pve-guests.service
similarity index 81%
rename from bin/init.d/pve-manager.service
rename to bin/init.d/pve-guests.service
index daba7d4e..d38c4796 100644
--- a/bin/init.d/pve-manager.service
+++ b/bin/init.d/pve-guests.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=PVE VM Manager
+Description=PVE guests (Service providing start-on-boot and 
stop-all-on-shutdown)
 ConditionPathExists=/usr/bin/pvesh
 RefuseManualStart=true
 RefuseManualStop=true
@@ -16,7 +16,7 @@ After=lxc.service
 After=pve-ha-crm.service pve-ha-lrm.service
 
 [Service]
-Environment="PVE_LOG_ID=pve-manager"
+Environment="PVE_LOG_ID=pve-guests"
 ExecStart=/usr/bin/pvesh --nooutput create /nodes/localhost/startall
 ExecStop=-/usr/bin/vzdump -stop
 ExecStop=/usr/bin/pvesh --nooutput create /nodes/localhost/stopall
@@ -26,3 +26,4 @@ TimeoutSec=infinity
 
 [Install]
 WantedBy=multi-user.target
+Alias=pve-manager.service
diff --git a/bin/init.d/pve-manager b/bin/init.d/pve-manager
deleted file mode 100755
index 4161f14f..00000000
--- a/bin/init.d/pve-manager
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-### BEGIN INIT INFO
-# Provides:        pve-manager
-# Required-Start:  $remote_fs pveproxy qemu-server pvestatd
-# Required-Stop:   $remote_fs pveproxy qemu-server pvestatd
-# Default-Start:   2 3 4 5
-# Default-Stop:    0 1 6
-# Short-Description: PVE VM Manager
-### END INIT INFO
-
-. /lib/lsb/init-functions
-
-PATH=/sbin:/bin:/usr/bin:/usr/sbin
-PVESH=/usr/bin/pvesh
-
-test -f $PVESH || exit 0
-
-PVE_LOG_ID=pve-manager
-export PVE_LOG_ID
-
-# Include defaults if available
-if [ -f /etc/default/pve-manager ] ; then
-    . /etc/default/pve-manager
-fi
-
-case "$1" in
-       start)
-               if [ "$START" = "no" ]; then
-                   exit 0
-               fi
-               echo "Starting VMs and Containers"
-               pvesh --nooutput create /nodes/localhost/startall 
-               ;;
-       stop)
-               echo "Stopping running Backup"
-               vzdump -stop
-               echo "Stopping VMs and Containers"
-               pvesh --nooutput create /nodes/localhost/stopall 
-               ;;
-       reload|restart|force-reload)
-               # do nothing here 
-               ;;
-       *)
-               N=/etc/init.d/$NAME
-               echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2
-               exit 1
-               ;;
-esac
-
-exit 0
diff --git a/debian/postinst b/debian/postinst
index 6cfb626f..23355ebd 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -52,6 +52,7 @@ case "$1" in
     # remove old/usused init.d files
     rm -f /etc/init.d/pvebanner
     rm -f /etc/init.d/pvenetcommit
+    rm -f /etc/init.d/pve-manager
 
     # create new daily randomize update cronjob if not exist
     MIN="$(shuf -i 0-59 -n 1)"
@@ -110,7 +111,7 @@ EOF
        fi
     done
 
-    for service in pvedaemon pveproxy spiceproxy pvestatd pvebanner 
pvenetcommit pve-manager; do
+    for service in pvedaemon pveproxy spiceproxy pvestatd pvebanner 
pvenetcommit pve-guests; do
        deb-systemd-helper unmask $service.service >/dev/null || true
 
        # was-enabled defaults to true, so new installations run enable.
diff --git a/debian/postrm b/debian/postrm
index 4792bb9a..5cc18ca4 100755
--- a/debian/postrm
+++ b/debian/postrm
@@ -22,7 +22,7 @@ esac
 # same as dh_systemd_enable (code copied)
 systemctl --system daemon-reload >/dev/null || true
 
-PVESERVICES="pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit 
pve-manager"
+PVESERVICES="pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit 
pve-guests"
 PVETIMERS="pvesr"
 
 if [ "$1" = "remove" ]; then
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to