base-files: don't modify enabled state of service on upgrade

Properly stop/start services on upgrade, but don't change the enabled
state.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jonas Gorski 2016-11-21 15:16:07 +01:00
parent a58f176ef2
commit afaa34ccd7
2 changed files with 13 additions and 11 deletions

View file

@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/version.mk
PKG_NAME:=base-files PKG_NAME:=base-files
PKG_RELEASE:=170 PKG_RELEASE:=171
PKG_FLAGS:=nonshared PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/

View file

@ -175,7 +175,9 @@ default_prerm() {
if [ -n "$root" ]; then if [ -n "$root" ]; then
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable
else else
"$i" disable if [ "$PKG_UPGRADE" != "1" ]; then
"$i" disable
fi
"$i" stop "$i" stop
fi fi
done done
@ -240,17 +242,17 @@ default_postinst() {
[ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null [ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null
if [ "$PKG_UPGRADE" != "1" ]; then local shell="$(which bash)"
local shell="$(which bash)" for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then
if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable else
else if [ "$PKG_UPGRADE" != "1" ]; then
"$i" enable "$i" enable
"$i" start
fi fi
done "$i" start
fi fi
done
return $ret return $ret
} }