Skip to content

fdm fails to delete lock file on error #150

@zoomosis

Description

@zoomosis

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions