Last modified: 2013-05-20 08:25:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49980, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47980 - [OPS] udp2log logs are recreated as root:root preventing logging
[OPS] udp2log logs are recreated as root:root preventing logging
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
deployment-prep (beta) (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-02 08:38 UTC by Antoine "hashar" Musso (WMF)
Modified: 2013-05-20 08:25 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2013-05-02 08:38:06 UTC
The deployment-bastion instance is a udp2log receiver for MediaWiki.  On log rotation, the logs files are recreated with root:root ownership which prevents the udp2log daemon from writing to it (it is run by user udp2log).

The instance has the class role::beta::logging::mediawiki which is really:  role::logging::mediawiki with /data/project/logs as a log directory.

The /etc/logrotate.d/udp2log-mw does not specify anything.  Maybe that is caused by the NFS mount.
Comment 1 Antoine "hashar" Musso (WMF) 2013-05-02 09:07:07 UTC
As root, I could not change the ownership of a log file on the NFS share:

 $ sudo touch /data/project/logs/logrotatetest.log
 $ ls -l /data/project/logs/logrotatetest.log
 $ -rw-rw-r-- 1 root root 0 May  2 08:49 /data/project/logs/logrotatetest.log
 $ sudo chown udp2log:udp2log logrotatetest.log 
 chown: changing ownership of `logrotatetest.log': Invalid argument
 $


`copytruncate` would solve that since the file is copied and then its content removed. But that would mean losing some logs sent between the two operations, I dont think this is acceptable for production.


`nocreate` would not attempt to recreate the log files. That would only work if HUP signal sent to udp2log actually recreate the file. I believe that is the case since when the files are rotated and recreated by log rotated, the inode changed and thus udp2log must be reopening them, possibly recreating it.
Comment 2 Gerrit Notification Bot 2013-05-02 09:29:24 UTC
Related URL: https://gerrit.wikimedia.org/r/61964 (Gerrit Change I048c6914b6bf7c93cc7d98658391ba90d388ff4b)
Comment 3 Antoine "hashar" Musso (WMF) 2013-05-20 08:25:40 UTC
This is now fixed. Maybe there was a NFS configuration issue as well.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links