depend on systemd, add service files
This commit is contained in:
parent
084f2240df
commit
6675a0648f
@ -7,14 +7,24 @@ SCRIPTS = \
|
||||
pvedaemon \
|
||||
pveproxy \
|
||||
spiceproxy \
|
||||
pvebanner \
|
||||
pvestatd \
|
||||
pvenetcommit
|
||||
pvestatd
|
||||
|
||||
|
||||
SERVICES= \
|
||||
pvebanner.service \
|
||||
pvenetcommit.service \
|
||||
pvestatd.service \
|
||||
pve-manager.service \
|
||||
pvedaemon.service \
|
||||
pveproxy.service \
|
||||
spiceproxy.service
|
||||
|
||||
.PHONY: install
|
||||
install: ${SCRIPTS}
|
||||
install -d ${INITDBINDIR}
|
||||
install -m 0755 ${SCRIPTS} ${INITDBINDIR}
|
||||
install -d ${SERVICEDIR}
|
||||
install -m 0644 ${SERVICES} ${SERVICEDIR}
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: pve-manager
|
||||
# Required-Start: $remote_fs pveproxy qemu-server +vz pvestatd
|
||||
# Required-Stop: $remote_fs pveproxy qemu-server +vz pvestatd
|
||||
# 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
|
||||
|
13
bin/init.d/pve-manager.service
Normal file
13
bin/init.d/pve-manager.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=PVE VM Manager
|
||||
ConditionPathExists=/usr/bin/pvesh
|
||||
Wants=pveproxy.service
|
||||
After=pveproxy.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/etc/init.d/pve-manager start
|
||||
ExecStop=/etc/init.d/pve-manager stop
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
13
bin/init.d/pvebanner.service
Normal file
13
bin/init.d/pvebanner.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Proxmox VE Login Banner
|
||||
ConditionPathExists=/usr/bin/pvebanner
|
||||
Wants=console-getty.service
|
||||
Before=console-getty.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/pvebanner
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=getty.target
|
13
bin/init.d/pvedaemon.service
Normal file
13
bin/init.d/pvedaemon.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=PVE API Daemon
|
||||
ConditionPathExists=/usr/bin/pvedaemon
|
||||
Requires=pve-cluster.service
|
||||
After=pve-cluster.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/etc/init.d/pvedaemon start
|
||||
ExecStop=/etc/init.d/pvedaemon stop
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
12
bin/init.d/pvenetcommit.service
Normal file
12
bin/init.d/pvenetcommit.service
Normal file
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Commit Proxmox VE network changes
|
||||
|
||||
[Service]
|
||||
ExecStartPre=-/bin/rm -f /etc/openvswitch/conf.db
|
||||
ExecStartPre=-/bin/mv /etc/network/interfaces.new /etc/network/interfaces
|
||||
ExecStart=/bin/true
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=networking.service
|
15
bin/init.d/pveproxy.service
Normal file
15
bin/init.d/pveproxy.service
Normal file
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=PVE API Proxy Server
|
||||
ConditionPathExists=/usr/bin/pveproxy
|
||||
Requires=pve-cluster.service
|
||||
Wants=pvedaemon.service
|
||||
After=pve-cluster.service
|
||||
After=pvedaemon.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/etc/init.d/pveproxy start
|
||||
ExecStop=/etc/init.d/pveproxy stop
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
13
bin/init.d/pvestatd.service
Normal file
13
bin/init.d/pvestatd.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=PVE Status Daemon
|
||||
ConditionPathExists=/usr/bin/pvestatd
|
||||
Requires=pve-cluster.service
|
||||
After=pve-cluster.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/etc/init.d/pvestatd start
|
||||
ExecStop=/etc/init.d/pvestatd stop
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
13
bin/init.d/spiceproxy.service
Normal file
13
bin/init.d/spiceproxy.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description= PVE SPICE Proxy Server
|
||||
ConditionPathExists=/usr/bin/spiceproxy
|
||||
Wants=pveproxy.service
|
||||
After=pveproxy.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/etc/init.d/spiceproxy start
|
||||
ExecStop=/etc/init.d/spiceproxy stop
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
2
debian/conffiles
vendored
2
debian/conffiles
vendored
@ -2,8 +2,6 @@
|
||||
/etc/init.d/pvedaemon
|
||||
/etc/init.d/pveproxy
|
||||
/etc/init.d/spiceproxy
|
||||
/etc/init.d/pvebanner
|
||||
/etc/init.d/pvenetcommit
|
||||
/etc/init.d/pvestatd
|
||||
/etc/cron.daily/pve
|
||||
/etc/vz/vznet.conf
|
||||
|
2
debian/control.in
vendored
2
debian/control.in
vendored
@ -3,7 +3,7 @@ Version: @VERSION@-@PACKAGERELEASE@
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: perl (>= 5.10.0-19), libtimedate-perl, libauthen-pam-perl, libintl-perl, rsync, libjson-perl, liblockfile-simple-perl, vncterm, qemu-server (>= 1.1-1), libwww-perl (>= 6.04-1), libnet-http-perl (>= 6.06-1), libhttp-daemon-perl, wget, libnet-dns-perl, vlan, ifenslave-2.6 (>= 1.1.0-10), liblinux-inotify2-perl, debconf (>= 0.5) | debconf-2.0, netcat-traditional, pve-cluster (>= 1.0-29), libpve-common-perl, libpve-storage-perl, libterm-readline-gnu-perl, libpve-access-control (>= 3.0-2), libio-socket-ssl-perl, libfilesys-df-perl, libfile-readbackwards-perl, libfile-sync-perl, redhat-cluster-pve, resource-agents-pve, fence-agents-pve, cstream, postfix | mail-transport-agent, libxml-parser-perl, lzop, dtach, libanyevent-perl, liburi-perl, logrotate, libanyevent-http-perl, apt-transport-https, libapt-pkg-perl, libcrypt-ssleay-perl, liblwp-protocol-https-perl, spiceterm, libuuid-perl, hdparm, gdisk, librados2-perl, pve-firewall, novnc-pve, libev-perl
|
||||
Depends: perl (>= 5.10.0-19), libtimedate-perl, libauthen-pam-perl, libintl-perl, rsync, libjson-perl, liblockfile-simple-perl, vncterm, qemu-server (>= 1.1-1), libwww-perl (>= 6.04-1), libnet-http-perl (>= 6.06-1), libhttp-daemon-perl, wget, libnet-dns-perl, vlan, ifenslave-2.6 (>= 1.1.0-10), liblinux-inotify2-perl, debconf (>= 0.5) | debconf-2.0, netcat-traditional, pve-cluster (>= 1.0-29), libpve-common-perl, libpve-storage-perl, libterm-readline-gnu-perl, libpve-access-control (>= 3.0-2), libio-socket-ssl-perl, libfilesys-df-perl, libfile-readbackwards-perl, libfile-sync-perl, cstream, postfix | mail-transport-agent, libxml-parser-perl, lzop, dtach, libanyevent-perl, liburi-perl, logrotate, libanyevent-http-perl, apt-transport-https, libapt-pkg-perl, libcrypt-ssleay-perl, liblwp-protocol-https-perl, spiceterm, libuuid-perl, hdparm, gdisk, librados2-perl, pve-firewall, novnc-pve, libev-perl, systemd
|
||||
Conflicts: netcat-openbsd, vzdump
|
||||
Replaces: vzdump
|
||||
Provides: vzdump
|
||||
|
51
debian/postinst
vendored
51
debian/postinst
vendored
@ -24,11 +24,12 @@ case "$1" in
|
||||
# test if /etc/pve is mounted; else simple exit to avoid
|
||||
# error during updates
|
||||
test -f /etc/pve/local/pve-ssl.pem || exit 0;
|
||||
|
||||
test -e /proxmox_install_mode || invoke-rc.d pvedaemon restart
|
||||
test -e /proxmox_install_mode || invoke-rc.d pvestatd restart
|
||||
test -e /proxmox_install_mode || invoke-rc.d pveproxy restart
|
||||
test -e /proxmox_install_mode || invoke-rc.d spiceproxy restart
|
||||
test -e /proxmox_install_mode && exit 0;
|
||||
|
||||
deb-systemd-invoke restart pvedaemon.service
|
||||
deb-systemd-invoke restart pvestatd.service
|
||||
deb-systemd-invoke restart pveproxy.service
|
||||
deb-systemd-invoke restart spiceproxy.service
|
||||
|
||||
exit 0;;
|
||||
|
||||
@ -57,23 +58,37 @@ case "$1" in
|
||||
fi
|
||||
|
||||
# disable fancy init messages (bad with bootlogd)
|
||||
test -f /etc/lsb-base-logging.sh || echo "FANCYTTY=0" >/etc/lsb-base-logging.sh
|
||||
test -f /etc/lsb-base-logging.sh || echo "FANCYTTY=0" >/etc/lsb-base-logging.sh
|
||||
|
||||
update-rc.d pvedaemon defaults 21 79 >/dev/null
|
||||
update-rc.d pveproxy defaults 21 79 >/dev/null
|
||||
update-rc.d spiceproxy defaults 21 79 >/dev/null
|
||||
update-rc.d pvestatd defaults 21 79 >/dev/null
|
||||
update-rc.d pvebanner start 99 2 3 4 5 . >/dev/null
|
||||
update-rc.d pvenetcommit start 15 S . >/dev/null
|
||||
update-rc.d pve-manager defaults 25 75 >/dev/null
|
||||
|
||||
test -e /proxmox_install_mode || invoke-rc.d pvedaemon restart
|
||||
test -e /proxmox_install_mode || invoke-rc.d pveproxy restart
|
||||
test -e /proxmox_install_mode || invoke-rc.d spiceproxy restart
|
||||
test -e /proxmox_install_mode || invoke-rc.d pvestatd restart
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
|
||||
# same as dh_systemd_enable (code copied)
|
||||
|
||||
for service in pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-manager; do
|
||||
deb-systemd-helper unmask $service.service >/dev/null || true
|
||||
|
||||
# was-enabled defaults to true, so new installations run enable.
|
||||
if deb-systemd-helper --quiet was-enabled $service.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable $service.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state $service.service >/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
if test ! -e /proxmox_install_mode; then
|
||||
|
||||
for service in pvedaemon pveproxy spiceproxy pvestatd; do
|
||||
deb-systemd-invoke restart $service
|
||||
done
|
||||
fi
|
||||
|
||||
# rewrite banner
|
||||
test -e /proxmox_install_mode || pvebanner || /bin/true
|
||||
test -e /proxmox_install_mode || pvebanner || true
|
||||
|
||||
#a2ensite pve.conf >/dev/null 2>&1
|
||||
|
||||
|
47
debian/postrm
vendored
47
debian/postrm
vendored
@ -3,17 +3,40 @@
|
||||
# Abort if any command returns an error value
|
||||
set -e
|
||||
|
||||
if [ "$1" = purge ]; then
|
||||
update-rc.d pvedaemon remove >/dev/null 2>&1
|
||||
update-rc.d pveproxy remove >/dev/null 2>&1
|
||||
update-rc.d spiceproxy remove >/dev/null 2>&1
|
||||
update-rc.d pvestatd remove >/dev/null 2>&1
|
||||
update-rc.d pvebanner remove >/dev/null 2>&1
|
||||
update-rc.d pvenetcommit remove >/dev/null 2>&1
|
||||
update-rc.d pve-manager remove >/dev/null 2>&1
|
||||
case "$1" in
|
||||
purge)
|
||||
rm -rf /var/log/pveproxy
|
||||
rm -rf /var/lib/pve-manager
|
||||
;;
|
||||
|
||||
if [ -e /usr/share/debconf/confmodule ]; then
|
||||
. /usr/share/debconf/confmodule
|
||||
db_purge
|
||||
fi
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# same as dh_systemd_enable (code copied)
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
|
||||
PVESERVICES="pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-manager"
|
||||
if [ "$1" = "remove" ]; then
|
||||
for service in ${PVESERVICES}; do
|
||||
echo "REMOVETEST $service";
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask $service.service >/dev/null
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$1" = purge ]; then
|
||||
for service in ${PVESERVICES}; do
|
||||
echo "PURGETEST $service";
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge $service.service >/dev/null
|
||||
deb-systemd-helper unmask $service.service >/dev/null
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
@ -9,6 +9,7 @@ PERLLIBDIR=${DESTDIR}/usr/share/perl5
|
||||
MAN1DIR=${DESTDIR}/usr/share/man/man1
|
||||
CRONDAILYDIR=${DESTDIR}/etc/cron.daily
|
||||
INITDBINDIR=${DESTDIR}/etc/init.d
|
||||
SERVICEDIR=${DESTDIR}/lib/systemd/system
|
||||
HARADIR=${DESTDIR}/usr/share/cluster
|
||||
DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
|
||||
PODDIR=${DESTDIR}/usr/share/doc/${PACKAGE}/pod
|
||||
|
Loading…
x
Reference in New Issue
Block a user