From 1d0b451857a58613deb0366cc3436a0bad25a938 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Thu, 2 Mar 2017 13:48:19 +0300 Subject: Introduce new binary package 'runit-helper', allowing packages to access fixes and improvements in 'dh-runit' without rebuild. --- postrm-runit | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'postrm-runit') diff --git a/postrm-runit b/postrm-runit index 5ce6acf..edd9ee7 100644 --- a/postrm-runit +++ b/postrm-runit @@ -1,44 +1,6 @@ # -*- shell-script -*- - -if [ "$1" = 'purge' ] ; then - # If runscript was never invoked, there will be no files - # in this directory, and `dpkg' will remove it. In this case, - # we have nothing to do. - for supervise in '/var/lib/runit/supervise/#NAME#' \ - '/var/lib/runit/log/supervise/#NAME#' ; do - if [ -d "$supervise" ] ; then - - # Actually only `down' may be absent, but it does not - # matter. - - for file in control lock ok pid stat status down ; do - rm -f "$supervise/$file" - done - - # It should be empty now. If it is not, it means that - # system administrator put something there. It is very - # stupid, but will of user is sacred, and directory is - # left as-is in such case. - # - # NOTE: Non-POSIX option is used. The day coreutils will - # no longer be essential, it will require a fix. - rmdir --ignore-fail-on-non-empty "$supervise" - fi - done -fi - -# Following code makes sure, that after removal of package, in default -# setup, the only files belonged to log user, belong to root. -# -# This way user can be safely removed, solving part of #848239 (need -# interoperation from dh-sysuser). -# -# Sure, system administrator can make stupid thing and chown some file -# to log user, but consequences do not seem to be so severe. After -# all, with great power comes great responsibility. -if [ -d '/var/log/runit/#NAME#' ] ; then - chown --recursive root:root '/var/log/runit/#NAME#' -fi +export NAME='#NAME#' +/lib/runit-helper/runit-helper postrm "$@" # Local Variables: # eval: (sh-set-shell "sh" t nil) -- cgit v1.2.3