Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 495084 - net-mail/fetchmail - systemd service dies after startup due to forking
Summary: net-mail/fetchmail - systemd service dies after startup due to forking
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
Keywords: PATCH
Depends on:
Reported: 2013-12-23 04:01 UTC by Christopher Byrne
Modified: 2019-10-27 08:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

Add type=forking to fetchmail service unit (fetchmail-forking-service.patch,555 bytes, patch)
2013-12-23 04:01 UTC, Christopher Byrne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Byrne 2013-12-23 04:01:13 UTC
Created attachment 365956 [details, diff]
Add type=forking to fetchmail service unit

The fetchmail service fork, but Type=forking is not specified in the [Service] section, so once fetchmail forks, the service dies.

This patch adds the necessary line to keep it alive. Note that fetchmail does support a "--nodaemon" (-N) option which could work as welll, the problem is fetchmail can (and often does) return exit codes other than 0 even on a clean exit. Exit code "8" is deemed a unsuccessful exit, but systemd has no "FailExitStatus" directive (the hypothetical complement of SuccessExitStatus)
Comment 1 Pacho Ramos gentoo-dev 2014-04-13 11:34:01 UTC
What about running it with "-d0" option to prevent forking?
Comment 2 Pacho Ramos gentoo-dev 2014-04-13 11:37:13 UTC
Also, our unit file is similar to the one used in opensuse and Arch that looks to pretend to restart the service when it dies after the time specified as -d parameter
Comment 3 Pacho Ramos gentoo-dev 2014-04-13 11:38:16 UTC
the only difference is that they specify -d 900 instead of -d 60