Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 291965 Details for
Bug 387009
net-mail/fetchmail - modified initscript to allow multiple daemons AND inlined configuration
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for /etc/init.d/fetchmail (net-mail/fetchmail-6.3.21)
fetchmail.init.patch (text/plain), 2.89 KB, created by
Pandu E Poluan
on 2011-11-08 12:11:04 UTC
(
hide
)
Description:
Patch for /etc/init.d/fetchmail (net-mail/fetchmail-6.3.21)
Filename:
MIME Type:
Creator:
Pandu E Poluan
Created:
2011-11-08 12:11:04 UTC
Size:
2.89 KB
patch
obsolete
>--- fetchmail 2011-11-08 18:55:58.000000000 +0700 >+++ fetchmail.new 2011-11-08 18:56:14.000000000 +0700 >@@ -2,18 +2,59 @@ > > piddir=${pid_dir:-/var/run/fetchmail} > pid_file=${piddir}/${RC_SVCNAME}.pid >-rcfile=/etc/${RC_SVCNAME}rc >+ >+# Need to define this variable here to make it global instead of local >+rcfile="" > > depend() { > need net > use mta > } > >+getrc() { >+# This function accepts a single (optional) parameter: quiet >+ if [ -z "${fetchmail_config}" ]; then >+ # Config is not explicitly set in the relevant conf.d file >+ if [ -z "${fetchmail_rc}" ]; then >+ # User does not specify which file to use. Let's go find the right one >+ if [ -f /etc/${RC_SVCNAME}.rc ]; then >+ # Newer naming system >+ rcfile="/etc/${RC_SVCNAME}.rc" >+ elif [ -f /etc/${RC_SVCNAME}rc ]; then >+ # Older naming system >+ rcfile="/etc/${RC_SVCNAME}rc" >+ else >+ [ "x$1" != "xquiet" ] && eerror "Can't find any proper configuration for ${RC_SVCNAME}" >+ return 1 >+ fi >+ else >+ if [ -f ${fetchmail_rc} ]; then >+ rcfile="${fetchmail_rc}" >+ else >+ [ "x$1" != "xquiet" ] && eerror "Can't find ${fetchmail_rc} configuration file for ${RC_SVCNAME}" >+ return 1 >+ fi >+ fi >+ [ "x$1" != "xquiet" ] && einfo "Using configuration file: ${rcfile}" >+ else >+ [ "x$1" != "xquiet" ] && einfo "Using provided configuration in /etc/conf.d/${RC_SVCNAME}" >+ # Config is explicitly specified. Let's dump it into a file to be read back by fetchmail >+ # Why dumping it into a file instead of other methods (e.g., named pipe)? This allows >+ # troubleshooting. >+ rcfile=${piddir}/${RC_SVCNAME}.rc >+ echo "${fetchmail_config}" > $rcfile >+ fi >+ # Ensure ownership and permissions to prevent fetchmail from complaining >+ # Only the user needs to be changed; fetchmail is okay with any group >+ chown fetchmail $rcfile >+ chmod 0700 $rcfile >+} >+ > checkconfig() { >- if [ ! -f ${rcfile} ]; then >- eerror "Configuration file ${rcfile} not found" >- return 1 >+ if [ ! -d ${piddir} ]; then >+ checkpath -q -d -o fetchmail:fetchmail -m 0755 ${piddir} || return 1 > fi >+ getrc || return 1 > local fetchmail_instance > fetchmail_instance=${RC_SVCNAME##*.} > if [ -n "${fetchmail_instance}" -a "${RC_SVCNAME}" != "fetchmail" ]; then >@@ -21,13 +62,10 @@ > else > fidfile=/var/lib/fetchmail/.fetchids > fi >- if [ ! -d ${piddir} ]; then >- checkpath -q -d -o fetchmail:fetchmail -m 0755 ${piddir} || return 1 >- fi > } > > start() { >- checkconfig || return 1 >+ checkconfig || return 1 > ebegin "Starting ${RC_SVCNAME}" > start-stop-daemon --start --pidfile ${pid_file} \ > --user fetchmail --exec /usr/bin/fetchmail \ >@@ -40,5 +78,12 @@ > ebegin "Stopping ${RC_SVCNAME}" > start-stop-daemon --stop --quiet --pidfile ${pid_file} > eend ${?} >-} > >+ # To assist troubleshooting (e.g., starting from shell using >+ # 'fetchmail -v -f $rcfile'), we do the courtesy of changing >+ # $rcfile's owner. >+ if getrc ; then >+ chown root $rcfile >+ chmod 0700 $rcfile >+ fi >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 387009
:
289729
|
289731
| 291965 |
291967