6

I fixed a permissin problem for nagios like discribed here.

The command was:

sudo dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
sudo dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3

Okay its obvious that it is some sort of permission altering. But where does it take place? Where is it stored? Is it just a chmod modification?

1
  • SmallClanger gave a perfect explanation. This command is usually called in maintainer scripts of Debian/Ubuntu packages to set persistant modes to files.
    – raphink
    May 26, 2011 at 13:18

2 Answers 2

16

dpkg-statoverride is the management tool for a database maintained by dpkg that contains owner and mode settings for given file paths.

Invoked as in your question, it will do two things: Set the owenrship/mode for the given files immediately if they exist (--update) and store a new entry in the override file (--add). The latter ensures that further dpkg operations that create or modify the listed files will use the override values rather than those defined by the package.

These overrides are permanent. They typically beats a normal chmod/chown since it saves you having to remember to reset the permissions manually when you update or reinstall the package.

Existing overrides can be listed by running dpkg-statoverride --list.

1
  • 1
    Very good answer. I would add that values are stored in a simple text file located in /var/lib/dpkg/statoverride.
    – raphink
    May 26, 2011 at 13:17
4

You could just do it manually. It is simply a change of permissions. The reason for using dpkg-statoverride is that it will remember it on updates and such.

It's a tool to tell dpkg to use those permissions. You are actually able to set it before installing the package as well.

The --update flag is used when changing permissions through dpkg-statoverride on files that already exists.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .