pt-stalk.conf is not searched for in cwd

Bug #871621 reported by Guillaume Lefranc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Unassigned

Bug Description

The directory path which is parsed is the one where pt-stalk resides, not the current working directory (as it is reported in the doc).

Example :
[tanj@a ~]$ pwd
/home/tanj
[tanj@a ~]$ sh -x /usr/bin/pt-stalk
+ '[' -f /usr/bin/pt-stalk.conf ']'

Thanks

Tags: pt-stalk
Revision history for this message
Guillaume Lefranc (tanj) wrote :

Patch following

--- pt-stalk 2011-09-01 11:01:03.000000000 -0500
+++ /usr/bin/pt-stalk 2011-10-10 02:57:18.000000000 -0500
@@ -7,8 +7,8 @@
 # ########################################################################
 # Check for the existence of a config file and source it if it exists
 # ########################################################################
-if [ -f "${0}.conf" ]; then
- . "${0}.conf"
+if [ -f "${0##*/}.conf" ]; then
+ . "${0##*/}.conf"
 fi

 # ########################################################################

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Thank you for reporting this. A couple days later, someone else reported the same bug: https://bugs.launchpad.net/percona-toolkit/+bug/880341

Since Baron commented on the latter bug, I'll close this one as a duplicate and we'll keep the latter one.

tags: added: pt-stalk
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.