Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
SmallClanger gave a perfect explanation. This command is usually called in maintainer scripts of Debian/Ubuntu packages to set persistant modes to files. –  ℝaphink May 26 '11 at 13:18

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
1  
Very good answer. I would add that values are stored in a simple text file located in /var/lib/dpkg/statoverride. –  ℝaphink May 26 '11 at 13:17

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.