Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 495084

Summary: net-mail/fetchmail - systemd service dies after startup due to forking
Product: Gentoo Linux Reporter: Salah Coronya <salah.coronya>
Component: Current packagesAssignee: Bernard Cafarelli <voyageur>
Status: UNCONFIRMED ---    
Severity: normal CC: net-mail, systemd
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Add type=forking to fetchmail service unit

Description Salah Coronya 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