Bug 1109084
| Summary: | systemtap script name with "-" not compile while using systemtap-initscript | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | masanari iida <masanari_iida> |
| Component: | systemtap | Assignee: | Frank Ch. Eigler <fche> |
| Status: | CLOSED ERRATA | QA Contact: | qe-baseos-tools-bugs |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.5 | CC: | jlebon, mcermak, mjw, scox, wcohen |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | systemtap-2.5-5.el6 | Doc Type: | Bug Fix |
| Doc Text: |
Cause: SystemTap initscripts names are limited to limited to using alphanumeric characters and underscores ('_'). The first character in the name must not be a number.
Consequence: SystemTap initscripts with hyphens ('-') or other non alphanumeric characters will not compile.
Fix: Use names that follow the allow naming scheme mentioned in "man systemtap"
Result:
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-10-14 06:32:15 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
masanari iida
2014-06-13 08:27:57 UTC
(In reply to masanari iida from comment #0) > Description of problem: > configure systemtap-initscript with script name hello-world.stp. > But if the script file name contain "-", it failed to start. Hello Masanari, Thanks for the report. This occurs because of the following in the systemtap initscript: eval reqs=\$${s}_REQ This is done when trying to determine if any script dependencies are specified in the config file (e.g. the variable for the dependencies of myscript would be myscript_REQ). However, if $s is not a valid Bash variable name, e.g. hello-world, then the eval above becomes: reqs=$hello-world_REQ which evaluates as reqs=-world_REQ since '$hello' is an empty variable. The script then thinks that the 'hello-world' script requires the '-world_REQ' script. It gets worse and worse from there... Regardless, had it been allowed, the script would not have compiled properly: Jun 13 12:11:02: Exec: /usr/bin/stap -m hello-world -p4 -r 2.6.32-431.17.1.el6.i686 -w -- /etc/systemtap/script.d/hello-world.stp ERROR: Safety pattern mismatch for -m parameter ('hello-world' vs. '^[a-z0-9_]+$') rc=1 Jun 13 12:11:02: Failed to compile script(hello-world). Jun 13 12:11:02: error In commit 4715f85, I've added checks which ensure that script names are valid so that we fail more gracefully. You would now see something like this in the logs: Jun 13 12:11:22: hello-world is not a valid script name (must match [a-zA-Z_][a-zA-Z0-9_]*) I've also updated the systemtap(8) man page in commit fbcde98 to clarify this issue: Scripts must be placed in the ${prefix}/etc/systemtap/script.d directory and must have a .stp extension. When referring to them on the command-line however, there in no need to include the .stp extension. Script names can only contain alphanumeric characters and must not start with a number. The scripts directory may be changed by setting the SCRIPT_PATH parameter in the configuration file. Jonathan Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1449.html |