Monitoring/bad directory owner

From Wikitech

The Icinga check called 'bad directory owner' checks if certain files are owned by the wrong user and need manual cleanup.

A defined type in puppet is used and located at modules/monitoring/manifests/icinga/bad_directory_owner.pp.

The most common case is files owned by root because somebody ran scripts as root when they should have used a deployment user.

As of May 2019 there is only one practical use of it on deployment servers where we check the mediawiki-staging directory.

The fix is to change ownership to the correct user.

This can be achieved by using find to both detect the affected files and run chown on them.

example: find /srv/mediawiki-staging/ -user root -exec chown mwdeploy:mwdeploy {} \;

also see: Find All The Files Owned By a Particular User / Group