Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 392562 Details for
Bug 533786
sys-process/fcron - /etc/init.d/fcron fails to get values from the config file
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch that fixes the issue.
file_533786.txt (text/plain), 2.72 KB, created by
Dimitrios Semitsoglou-Tsiapos
on 2014-12-28 13:41:13 UTC
(
hide
)
Description:
Patch that fixes the issue.
Filename:
MIME Type:
Creator:
Dimitrios Semitsoglou-Tsiapos
Created:
2014-12-28 13:41:13 UTC
Size:
2.72 KB
patch
obsolete
>Index: fcron.init.3 >=================================================================== >RCS file: /var/cvsroot/gentoo-x86/sys-process/fcron/files/fcron.init.3,v >retrieving revision 1.1 >diff -u -r1.1 fcron.init.3 >--- fcron.init.3 29 Aug 2012 17:38:40 -0000 1.1 >+++ fcron.init.3 28 Dec 2014 13:35:53 -0000 >@@ -3,28 +3,35 @@ > # Distributed under the terms of the GNU General Public License v2 > # $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/files/fcron.init.3,v 1.1 2012/08/29 17:38:40 flameeyes Exp $ > >-FCRON_INSTANCE=${SVCNAME##*.} >+FCRON_INSTANCE="${SVCNAME##*.}" > >-configfile() { >- if [ -n "${FCRON_INSTANCE}" -a "${SVCNAME}" != "fcron" ]; then >- echo /etc/fcron/fcron.${FCRON_INSTANCE}.conf >- else >- echo /etc/fcron/fcron.conf >- fi >-} >+if [ -n "${FCRON_INSTANCE}" ] && [ "${SVCNAME}" != "fcron" ]; then >+ configfile=/etc/fcron/fcron."${FCRON_INSTANCE}".conf >+else >+ configfile=/etc/fcron/fcron.conf >+fi > > getconfig() { >- # if there is no configuration file return the default value >- if ! [ -f $(configfile) ]; then >- echo $2 >- return 0 >+ key="$1" >+ default="$2" >+ >+ if [ -f "$configfile" ]; then >+ value="$(sed -n -e 's:^'"$key"'[ \t]*=[ \t]*::p' "$configfile")" >+ fi >+ >+ if [ ! -z "$value" ]; then >+ # Value not explicitly set in the configfile or configfile is not >+ # present, assume default >+ echo "$default" >+ else >+ echo "$value" > fi > >- sed -n -e 's:^$1[ \t]*=[ \t]*::p' $(configfile) >+ return 0 > } > > depend() { >- config $(configfile) >+ config "$configfile" > > use logger > need clock hostname >@@ -33,26 +40,26 @@ > } > > command="/usr/libexec/fcron" >-command_args="-c $(configfile)" >-pidfile=$(getconfig pidfile /var/run/fcron.pid) >-fcrontabs=$(getconfig fcrontabs /var/spool/fcron) >+command_args="-c $configfile" >+pidfile="$(getconfig pidfile /var/run/fcron.pid)" >+fcrontabs="$(getconfig fcrontabs /var/spool/fcron)" > > extra_started_commands="reload" > > start_pre() { >- if [ ! -e $(configfile) ]; then >- eerror "You will need to create $(configfile) first" >- eerror "There is a sample in /etc/fcron" >- return 1 >+ if [ ! -e "$configfile" ]; then >+ eerror "You will need to create $configfile first" >+ eerror "There is a sample in /etc/fcron" >+ return 1 > fi > >- if [ ! -d ${fcrontabs} ]; then >- ebegin "Creating missing spooldir ${fcrontabs}" >- ${command} --newspooldir ${fcrontabs} >- eend $? >+ if [ ! -d "${fcrontabs}" ]; then >+ ebegin "Creating missing spooldir ${fcrontabs}" >+ ${command} --newspooldir "${fcrontabs}" >+ eend $? > fi > } > > reload() { >- kill -HUP `cat ${pidfile}` >+ kill -HUP "$(<"$pidfile")" > }
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 533786
: 392562