Bug#840469: dh_sysuser: should add a dependency to "perl-modules" to remove sysuser.

Dmitry Bogatov KAction at gnu.org
Fri Oct 21 07:37:29 UTC 2016


>   There is no guarantee that package dependencies will be available
>   when postrm is run, but the depended-on package is more likely to be
>   available if the package declares a dependency (particularly in the
>   case of postrm remove). The postrm script must gracefully skip actions
>   that require a dependency if that dependency isn't available.
>
> So apparently you'll need to handle this deluser failure mode in the
> postrm script.

It is unfortunate. I am considering following patch:

	--- a/postrm-sysuser.sh
	+++ b/postrm-sysuser.sh
	@@ -3,6 +3,8 @@
	 if [ "$1" = purge ] ; then
	        rm -f "$store/$package"
	        if [ $(count_files_in "$store") = 1 ] ; then
	-               deluser --force --remove-home "$username"
	+               home=$(getent passwd "$username"| cut -d: -f6)
	+               deluser --force "$username"
	+               rm -fr --preserve-root --one-file-system -- "$home"
	        fi
	 fi

but I am scared to invoke `rm -fr' with root. I beleive, that deluser would
handle it better then me.

Ah, and by the way, why `adduser' package, from which `deluser' binary comes
is still present during post-rm? `adduser' is not Essential, only Important.

I know that abusing Pre-Depends is frowned upon, but would
Pre-Depends: perl help?

-- 
X-Web-Site: https://sinsekvu.github.io | Note that I process my email in batch,
Accept-Languages: eo,ru,en             | at most once every 24 hours. If matter
Accept: text/plain, text/x-diff        | is urgent, you have my phone number.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/perl-maintainers/attachments/20161021/797aeb22/attachment.sig>


More information about the Perl-maintainers mailing list