init scripts, /var/run and dpkg-statoverride

James Westby jw+debian at jameswestby.net
Mon Nov 24 15:26:46 GMT 2008


Hi,

Some packages require certain ownership of or permissions on directories
in /var/run. These packages chown/chmod the directories in the 
postinst. As we all know Ubuntu has /var/run on a tmpfs, and as such we
move code to do this from the postinst to the init script.

The correct thing to do is to guard these operations by a call to
dpkg-statoverride to allow the admin to override permissions. However, I
have seen cases where we have a bare chown/chmod in the init script, so
we don't support that.

Is this something that we want to support? Does it even make any
sense for directories on a tmpfs?

Thanks,

James

P.S. it is important to actually move code that changes
permissions on /var/run directories from the postinst to the init
script, i.e. don't leave it in the postinst. This is because a reboot
between the package being unpacked and configured will cause an error
as the directory will not be present. If the postinst needs the 
directory before running init script then have an explicit mkdir in 
the postinst, and don't rely on the directory being shipped in the
package.



More information about the ubuntu-devel mailing list