This is an enhancement on the initscript I suggested (and the maintainer accepted) in bug #380371. The enchancement is a 'drop in' to the prior initscipt (IOW, people already using the initscript in #380371 should have no problem whatsoever after patching their initscript with the provided diff). The enhancements are: * Allow 'inline' configuration in the related conf file in /etc/conf.d (optional, and not used by default) * Allow to specify a configuration file not necessarily in /etc (and using custom name) * By default, searches for ${RC_SVCNAME}.rc (notice the dot) before searching for ${RC_SVCNAME}rc (many people forgot to append the "rc"; adding a dot "." before "rc" should help remind them) Reproducible: Always For the reasons why I modify fetchmail's initscript as such, please refer to my reasoning in bug #380371 NOTE: Since the initscript now allows using ".rc", I also recommend the ebuild and/or man page to specify /etc/fetchmail.rc instead of /etc/fetchmailrc
Created attachment 289729 [details, diff] diff for fetchmail's initscript
Created attachment 289731 [details, diff] diff for fetchmail's conf
Forgot to list this in the list of enhancements: * Automatically perform the necessary chown and chmod on the rcfile before trying to start fetchmail * As a courtesy, also perform a chown and chmod on the rcfile when stopping fetchmail, to assist in troubleshooting (e.g., 'fetchmail -v -f $rcfile') (The reason for the two enhancements here is because fetchmail *insists* on having the file's owners *exactly* match the EUID and permissions *exactly* set to 0700)
Meh, I noticed that my patches no longer work with the latest net-mail/fetchmail (net-mail/fetchmail-6.3.21) I'm uploading a set of patches that work with net-mail/fetchmail-6.3.21,
Created attachment 291965 [details, diff] Patch for /etc/init.d/fetchmail (net-mail/fetchmail-6.3.21) This patch works for /etc/init.d/fetchmail of net-mail/fetchmail-6.3.21. Should be a 'drop-in' patch (i.e., no need to change/rename fetchmail's rc files)
Created attachment 291967 [details, diff] Patch for /etc/conf.d/fetchmail (net-mail/fetchmail-6.3.21) This patch works for /etc/init.d/fetchmail of net-mail/fetchmail-6.3.21. Should be a 'drop-in' patch (i.e., no need to change/rename fetchmail's rc files). The main difference with the obsoleted patch #289731 is in how the example configuration is given.