fdm
fdm copied to clipboard
fdm fails to delete lock file on error
fdm refuses to restart after an error due to the previous instance failing to delete its lock file:
version is: fdm 2.2, started at: Sat Oct 11 19:57:00 2025
pmail: got message 1 of 1: size 1869, body 1825
pmail: message 1, running action INBOX:0 (maildir) as user morgan
pmail: io: poll: Operation timed out
pmail: fetching error. aborted
pmail: 0 messages processed in 35.306 seconds
fatal: main: privsep_recv error
version is: fdm 2.2, started at: Sat Oct 11 20:00:00 2025
already running (/home/morgan/.fdm.lock exists)
version is: fdm 2.2, started at: Sat Oct 11 20:03:00 2025
already running (/home/morgan/.fdm.lock exists)
version is: fdm 2.2, started at: Sat Oct 11 20:06:00 2025
already running (/home/morgan/.fdm.lock exists)
...
I believe the fix here is to call unlink(conf.lock_file) before exit(1) in log_vfatal().
Though I suspect it would be more reliable to use atexit() to call unlink().
I think this is intentional, it is a fatal error not a normal exit.
I think this is intentional, it is a fatal error not a normal exit.
The current behaviour is not documented anywhere and violates POLA.
Probably the main process should not be calling fatal when a child times out.