[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg-statoverride question

On Tue, Sep 24, 2002 at 02:00:20PM +1000, Brian May wrote:
> Hello,
> In my amavis-postfix postinst file, I have:
> case "$1" in
>     configure)
> 	adduser --system --home /var/lib/amavis --no-create-home amavis
> 	for i in /var/lib/amavis /var/lib/amavis/virusmails /var/run/amavis
> 	do
> 		if ! dpkg-statoverride --list $i >/dev/null
> 		then
> 			dpkg-statoverride --update --add amavis root 755 $i
> 		fi
> 		[...]
> 	done
>     [...]
> esac
> I was under the impression that this would allow overriding
> the ownership of the file outside the package.

Should do, yes.

> However, every time I reinstall the package, it goes back to
> the defaults.
> Just to make sure, I typed in "dpkg-statoverride --list /var/lib/amavis"
> before and after, and it is correct before, but wrong afterwords.
> For the record, I have Russell's SE-Linux version of dpkg but recompiled
> for woody. It is based on version 1.9.21.
> Any ideas?

That looks weird.  Perhaps you could remove the '>/dev/null' and also
put in a call to dpkg-statoverride followed by "echo $?" so we can see
what's happening?

> (PS: that adduser code is also a bit dodgy, currently it removes
> the user and re-adds it on upgrades; suggestions for a better place
> to put this, and the corresponding remove user call appreciated ;-).

adduser doesn't readd an already existing user; does that help?



      Julian Gilbey, Dept of Maths, Queen Mary, Univ. of London
              website: http://www.maths.qmul.ac.uk/~jdg/
   Debian GNU/Linux Developer, see: http://people.debian.org/~jdg/
     Visit http://www.thehungersite.com/ to help feed the hungry

Reply to: