mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Attempt to improve services management in Debian packaging
This commit is contained in:
parent
1300f4c0ca
commit
5664efad1d
5 changed files with 32 additions and 9 deletions
20
debian/postinst
vendored
20
debian/postinst
vendored
|
@ -15,11 +15,17 @@ do_configure() {
|
||||||
yunohost service regenconf
|
yunohost service regenconf
|
||||||
|
|
||||||
# restart yunohost-firewall if it's running
|
# restart yunohost-firewall if it's running
|
||||||
service yunohost-firewall status > /dev/null \
|
if service yunohost-firewall status >/dev/null; then
|
||||||
&& service yunohost-firewall restart \
|
update-rc.d yunohost-firewall defaults >/dev/null
|
||||||
|| echo "Service yunohost-firewall is not running, you should " \
|
[ -d /run/systemd/system ] \
|
||||||
|
&& systemctl --system daemon-reload >/dev/null || true
|
||||||
|
echo "Restarting yunohost-firewall..."
|
||||||
|
invoke-rc.d yunohost-firewall restart || true
|
||||||
|
else
|
||||||
|
echo "Service yunohost-firewall is not running, you should " \
|
||||||
"consider to start it by doing 'service yunohost-firewall start'."
|
"consider to start it by doing 'service yunohost-firewall start'."
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# update PAM configs
|
# update PAM configs
|
||||||
pam-auth-update --package
|
pam-auth-update --package
|
||||||
|
@ -48,10 +54,14 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Enable and start yunohost-api service for non-systemd system
|
# Enable and start yunohost-api sysv service
|
||||||
if [ -x /etc/init.d/yunohost-api ] && [ ! -d /run/systemd/system ]; then
|
if [ -x /etc/init.d/yunohost-api ]; then
|
||||||
update-rc.d yunohost-api defaults >/dev/null
|
update-rc.d yunohost-api defaults >/dev/null
|
||||||
|
if [ -d /run/systemd/system ]; then
|
||||||
|
systemctl --system daemon-reload >/dev/null || true
|
||||||
|
else
|
||||||
invoke-rc.d yunohost-api start || exit $?
|
invoke-rc.d yunohost-api start || exit $?
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#DEBHELPER#
|
#DEBHELPER#
|
||||||
|
|
12
debian/postrm
vendored
Normal file
12
debian/postrm
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "$1" = "purge" ]; then
|
||||||
|
update-rc.d yunohost-api remove >/dev/null
|
||||||
|
update-rc.d yunohost-firewall remove >/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
5
debian/prerm
vendored
5
debian/prerm
vendored
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -x "/etc/init.d/yunohost-firewall" ]; then
|
if [ -x /etc/init.d/yunohost-api ] && ! [ -d /run/systemd/system ]; then
|
||||||
invoke-rc.d yunohost-firewall stop || exit $?
|
invoke-rc.d yunohost-api stop || exit $?
|
||||||
|
invoke-rc.d yunohost-firewall stop || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#DEBHELPER#
|
#DEBHELPER#
|
||||||
|
|
0
debian/yunohost-api.init
vendored
Executable file → Normal file
0
debian/yunohost-api.init
vendored
Executable file → Normal file
0
debian/yunohost-firewall.init
vendored
Executable file → Normal file
0
debian/yunohost-firewall.init
vendored
Executable file → Normal file
Loading…
Add table
Reference in a new issue