From: Dietmar Maurer Date: Thu, 11 Jun 2015 07:26:03 +0000 (+0200) Subject: updates for PVE 4.0 (Debian Jessie) X-Git-Url: https://git.proxmox.com/?p=ksm-control-daemon.git;a=commitdiff_plain;h=1642c47596579a672f9beb0e5f7106d9e562f44e updates for PVE 4.0 (Debian Jessie) use systemd --- diff --git a/Makefile b/Makefile index 7574e1c..dfa81d7 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -RELEASE=3.0 +RELEASE=4.0 PACKAGE=ksm-control-daemon # also update debian/changelog -PKGVER=1.1 +PKGVER=1.2 PKGREL=1 KSM_DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb diff --git a/debian/changelog b/debian/changelog index cfabf12..12dfa6d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ksm-control-daemon (1.2-1) unstable; urgency=medium + + * updates for PVE 4.0 + + * use systemd + + -- Proxmox Support Team Thu, 11 Jun 2015 09:22:04 +0200 + ksm-control-daemon (1.1-1) unstable; urgency=low * first version for PVE 2.0 diff --git a/debian/compat b/debian/compat index 7ed6ff8..7f8f011 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +7 diff --git a/debian/control b/debian/control index 597c574..ebc9760 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Source: ksm-control-daemon Section: admin Priority: optional Maintainer: Proxmox Support Team -Build-Depends: debhelper (>= 7) +Build-Depends: debhelper (>= 7), quilt, dh-systemd (>= 1.4) Standards-Version: 3.7.3 Homepage: http://pve.proxmox.com Package: ksm-control-daemon Architecture: all -Depends: bash (>= 3.2) -Description: The KSM tuning daemon +Depends: bash (>= 3.2), systemd +Description: Kernel Samepage Merging (KSM) Tuning Daemon This package contains the KSM tuning daemon which controls whether ksm should ksm search duplicated pages. diff --git a/debian/ksmtuned.service b/debian/ksmtuned.service new file mode 100644 index 0000000..ffdaee1 --- /dev/null +++ b/debian/ksmtuned.service @@ -0,0 +1,10 @@ +[Unit] +Description=Kernel Samepage Merging (KSM) Tuning Daemon + +[Service] +ExecStart=/usr/sbin/ksmtuned +ExecReload=/bin/kill -USR1 $MAINPID +Type=forking + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/debian/postinst b/debian/postinst index bd1e873..4ef91c3 100644 --- a/debian/postinst +++ b/debian/postinst @@ -13,68 +13,22 @@ set -e case "$1" in - configure) - # Configure this package. If the package must prompt the user for - # information, do it here. - - # There are three sub-cases: - if test "${2+set}" != set; then - # We're being installed by an ancient dpkg which doesn't remember - # which version was most recently configured, or even whether - # there is a most recently configured version. - : - - elif test -z "$2" -o "$2" = ""; then - # The package has not ever been configured on this system, or was - # purged since it was last configured. - : - - else - # Version $2 is the most recently configured version of this - # package. - : - - fi ;; - abort-upgrade) - # Back out of an attempt to upgrade this package FROM THIS VERSION - # to version $2. Undo the effects of "prerm upgrade $2". - : - + configure) ;; - abort-remove) - if test "$2" != in-favour; then - echo "$0: undocumented call to \`postinst $*'" 1>&2 - exit 0 - fi - # Back out of an attempt to remove this package, which was due to - # a conflict with package $3 (version $4). Undo the effects of - # "prerm remove in-favour $3 $4". - : + abort-upgrade|abort-remove|abort-deconfigure) ;; - abort-deconfigure) - if test "$2" != in-favour -o "$5" != removing; then - echo "$0: undocumented call to \`postinst $*'" 1>&2 - exit 0 - fi - # Back out of an attempt to deconfigure this package, which was - # due to package $6 (version $7) which we depend on being removed - # to make way for package $3 (version $4). Undo the effects of - # "prerm deconfigure in-favour $3 $4 removing $6 $7". - : + + *) + echo "$0: didn't understand being called with \`$1'" 1>&2 + exit 1 ;; - *) echo "$0: didn't understand being called with \`$1'" 1>&2 - exit 0;; esac -if [ -x "/etc/init.d/ksmtuned" ]; then - update-rc.d ksmtuned defaults 21 >/dev/null 2>&1 - if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d ksmtuned start || exit $? - else - /etc/init.d/ksmtuned start || exit $? - fi -fi +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# exit 0 diff --git a/debian/postrm b/debian/postrm index f44f7b2..aa8f7a6 100644 --- a/debian/postrm +++ b/debian/postrm @@ -1,8 +1,26 @@ -#! /bin/sh +#!/bin/sh +# +# see: dh_installdeb(1) -# Abort if any command returns an error value set -e -if [ "$1" = purge ]; then - update-rc.d ksmtuned remove >/dev/null 2>&1 -fi +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + purge) + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# diff --git a/debian/rules b/debian/rules index 829a3bb..e9c0ac4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,97 +1,26 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +# output every command that modifies files on the build system. +#DH_VERBOSE = 1 -ifneq "$(wildcard /usr/share/quilt/quilt.make)" "" -include /usr/share/quilt/quilt.make -endif +# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk -destdir := $(CURDIR)/debian/ksm-control-daemon - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - - touch configure-stamp - - -build: patch build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - # nothing to do +%: + dh $@ --with quilt,systemd - touch $@ -clean: unpatch - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - # nothing to do - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs +destdir := $(CURDIR)/debian/ksm-control-daemon +override_dh_auto_install: # Add here commands to install the package into debian/ksm-control-scripts. #$(MAKE) DESTDIR=$(CURDIR)/debian/ksm-control-scripts install - install -D -m 0755 $(CURDIR)/ksmtuned.init $(destdir)/etc/init.d/ksmtuned + #install -D -m 0755 $(CURDIR)/ksmtuned.init $(destdir)/etc/init.d/ksmtuned install -D -m 0755 $(CURDIR)/ksmtuned $(destdir)/usr/sbin/ksmtuned install -D -m 0644 $(CURDIR)/debian/defaults $(destdir)/etc/default/ksmtuned install -D -m 0644 $(CURDIR)/ksmtuned.conf $(destdir)/etc/ksmtuned.conf - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_python -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +override_dh_systemd_enable: + dh_systemd_enable --name ksmtuned