File: runit.postrm

package info (click to toggle)
runit 2.2.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,568 kB
  • sloc: ansic: 6,071; sh: 3,419; makefile: 399
file content (36 lines) | stat: -rwxr-xr-x 1,155 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -e

if [ "$1" = "purge" ] ; then
	if [ -h /etc/runit/runsvdir/current ]; then
                rm /etc/runit/runsvdir/current
	fi
	if [ -h /etc/runit/runsvdir/previous ]; then
		rm /etc/runit/runsvdir/previous
	fi
	if [ -h /usr/share/runit/sv.current ]; then
		rm /usr/share/runit/sv.current
	fi
	if [ -h /usr/share/runit/sv.src ]; then
		rm /usr/share/runit/sv.src
	fi
	if  rmdir /usr/share/runit/sv.now 2>/dev/null ; then
		rmdir --ignore-fail-on-non-empty /usr/share/runit
	fi
fi

#DEBHELPER#

#fallback for runit-helper already removed
if [ "$1" = "purge" ] ; then
	if [ -z "${DPKG_ROOT:-}" ] && [ ! -x /lib/runit-helper/runit-helper ] ; then
		rm -f  /etc/runit/runsvdir/default/default-syslog
		rm -rf /etc/sv/default-syslog/supervise
		rm -rf /etc/sv/default-syslog
	fi
fi
# we switched from runit-log to _runit-log in 2.1.2-36, but it still nice for old installation
# to remove the old user in purge, even if the package no longer provides it (since 2.1.2-54exp1)
if [ -x /lib/sysuser-helper/sysuser-helper ] ; then
	CONF_HOME=/nonexistent CONF_PACKAGE=runit CONF_USERNAME=runit-log /lib/sysuser-helper/sysuser-helper postrm "$@"
fi