View Issue Details

IDProjectCategoryView StatusLast Update
0005918unrealircdpublic2022-01-31 10:26
ReporterDarthGandalf Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformamd64OSLinuxOS Version5.11.0
Product Version5.2.0 
Fixed in Version6.0.3 
Summary0005918: Log isn't logging after restart via IRC
Description*** WARNING: Unable to write to '/home/a/unrealircd/logs/ircd.log': Bad file descriptor. This warning will not re-appear for at least 5 minutes.

Looking at /proc/.../fd, I see this:

lr-x------ 1 a a 64 Jun 20 00:53 0 -> /dev/null
l-wx------ 1 a a 64 Jun 20 00:53 1 -> /dev/null
l-wx------ 1 a a 64 Jun 20 00:53 10 -> /dev/null
l-wx------ 1 a a 64 Jun 20 00:53 11 -> /dev/null
lrwx------ 1 a a 64 Jun 20 00:53 12 -> 'socket:[336060]'
lrwx------ 1 a a 64 Jun 20 00:53 13 -> 'socket:[336039]'
l-wx------ 1 a a 64 Jun 20 00:53 2 -> /dev/null
lrwx------ 1 a a 64 Jun 20 00:53 3 -> 'anon_inode:[eventpoll]'
lrwx------ 1 a a 64 Jun 20 00:53 4 -> 'socket:[336029]'
lrwx------ 1 a a 64 Jun 20 00:53 5 -> 'socket:[336030]'
lrwx------ 1 a a 64 Jun 20 00:53 6 -> 'socket:[336031]'
lrwx------ 1 a a 64 Jun 20 00:53 7 -> 'socket:[336032]'
lrwx------ 1 a a 64 Jun 20 00:53 8 -> 'socket:[336033]'
lr-x------ 1 a a 64 Jun 20 00:53 9 -> /dev/null

If I restart using ./unrealircd restart, that warning disappears, and I see this:

lr-x------ 1 a a 64 Jun 20 00:52 0 -> /dev/null
l-wx------ 1 a a 64 Jun 20 00:52 1 -> /dev/null
lrwx------ 1 a a 64 Jun 20 00:52 10 -> 'socket:[335909]'
lrwx------ 1 a a 64 Jun 20 00:52 11 -> 'socket:[335910]'
lr-x------ 1 a a 64 Jun 20 00:52 12 -> /dev/null
l-wx------ 1 a a 64 Jun 20 00:52 13 -> /dev/null
l-wx------ 1 a a 64 Jun 20 00:52 14 -> /dev/null
lrwx------ 1 a a 64 Jun 20 00:52 15 -> 'socket:[335936]'
lrwx------ 1 a a 64 Jun 20 00:52 17 -> 'socket:[335916]'
l-wx------ 1 a a 64 Jun 20 00:52 2 -> /dev/null
l-wx------ 1 a a 64 Jun 20 00:52 3 -> /home/a/unrealircd/logs/ircd.log
lrwx------ 1 a a 64 Jun 20 00:52 4 -> 'socket:[335904]'
lrwx------ 1 a a 64 Jun 20 00:52 5 -> 'socket:[335905]'
lrwx------ 1 a a 64 Jun 20 00:52 6 -> 'anon_inode:[eventpoll]'
lrwx------ 1 a a 64 Jun 20 00:52 7 -> 'socket:[335906]'
lrwx------ 1 a a 64 Jun 20 00:52 8 -> 'socket:[335907]'
lrwx------ 1 a a 64 Jun 20 00:52 9 -> 'socket:[335908]'

Note that ircd.log exists, unlike before
Steps To Reproduce1. Add server {restart;} to permissions of operclass
2. /oper
3. /restart
TagsNo tags attached.
3rd party modules

Activities

DarthGandalf

2021-06-20 02:07

reporter   ~0022019

The version is from git, commit 991f9f347e8d2

syzop

2022-01-31 10:26

administrator   ~0022389

Fixed in future 6.0.3. Thanks for the report!

https://github.com/unrealircd/unrealircd/commit/ef6ea6ee329bcc48613340d2f369b651559d85dd

commit ef6ea6ee329bcc48613340d2f369b651559d85dd (HEAD -> unreal60_dev, origin/unreal60_dev)
Author: Bram Matthys <syzop@vulnscan.org>
Date: Mon Jan 31 10:24:13 2022 +0100

    When using "RESTART" the newly started IRCd could possibly not log or been
    missing other functionality.
    Reported by DarthGandalf in https://bugs.unrealircd.org/view.php?id=5918
    
    The cause was that all fd's were closed, including 0/1/2. We now reopen
    those and map them to /dev/null, like we do later again.

Issue History

Date Modified Username Field Change
2021-06-20 02:06 DarthGandalf New Issue
2021-06-20 02:07 DarthGandalf Note Added: 0022019
2022-01-31 10:26 syzop Assigned To => syzop
2022-01-31 10:26 syzop Status new => resolved
2022-01-31 10:26 syzop Resolution open => fixed
2022-01-31 10:26 syzop Fixed in Version => 6.0.3
2022-01-31 10:26 syzop Note Added: 0022389