Opened 2 years ago

Closed 2 years ago

#19691 closed defect (fixed)

does not re-open logfiles properly

Reported by: weasel Owned by: isis
Priority: High Milestone:
Component: Obfuscation/BridgeDB Version:
Severity: Normal Keywords: bridgedb-0.3.7
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

the running bridgedb has filedescriptors open for logfiles that have been rotated away.

# dsa-check-libs --verbose
Running /usr/bin/lsof -F0 -n
adding bridgedb(2618) because of [/srv/bridges.torproject.org/log/server.log-20160705 (deleted)]:
f1awl tREGG0x8401;0x0D0x801s11769i132741k0n/srv/bridges.torproject.org/log/server.log-20160705 (deleted)
adding bridgedb(2618) because of [/srv/bridges.torproject.org/log/server.log-20160705 (deleted)]:
f2awl tREGG0x8401;0x0D0x801s11769i132741k0n/srv/bridges.torproject.org/log/server.log-20160705 (deleted)

This not only is a bug, it also confuses our monitoring about services that need to be restarted.

Child Tickets

Change History (9)

comment:1 Changed 2 years ago by isis

It's not actually BridgeDB doing this, but instead the bash invocation in /srv/bridges.torproject.org/bin/run-bridgedb:

bridgedb -r ${RUN_DIR} -c ${BRIDGEDB_CONFIG} < /dev/null >> ${BRIDGEDB_SERVER_LOGFILE} 2>&1 & disown

I could just stop calling it that way… but it's the only way to catch things Python might print to stderr/stdout.

comment:2 Changed 2 years ago by isis

Weasel, could you install flog on polyanthum, please? (https://packages.debian.org/jessie/flog)

comment:3 Changed 2 years ago by weasel

done

comment:4 Changed 2 years ago by isis

Keywords: bridgedb-0.3.7 added
Status: newneeds_review

See commit 3554ff65 in the bridgedb-admin repo for the change to the bin/run-bridgedb script to call flog for logging Python errors, and my fix/19691 branch in the bridgedb repo for documentation of the change.

comment:5 Changed 2 years ago by isis

Resolution: fixed
Status: needs_reviewclosed

I had to make some changes to the above patch, they're in commit e3267177 in the bridgedb-admin repo. This is now deployed.

comment:6 Changed 2 years ago by weasel

Resolution: fixed
Status: closedreopened
tor-nagios: [polyanthum] upgraded libraries is WARNING: The following processes have libs linked that were upgraded: bridgedb: flog (20566)

I suspect the logrotate configuration should include a postrotate snippet to send a SIGHUP to flog.

comment:7 Changed 2 years ago by isis

Resolution: fixed
Status: reopenedclosed

SIGHUPs to flog are added in commit a218b01a.

comment:8 Changed 2 years ago by isis

Resolution: fixed
Status: closedreopened

comment:9 Changed 2 years ago by isis

Resolution: fixed
Status: reopenedclosed

This is now handled in the logrotate config.

Note: See TracTickets for help on using tickets.