Project

General

Profile

Actions

Bug #8933

closed

Multi-line command in post-modification hooks works incorrectly

Added by Dmitry Svyatogorov about 8 years ago. Updated about 5 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

Hooks with dashes (m.b. other chars) are broken till now. E.g.:
Write hook (in my example it is "Download a file from the shared folder" directive for Ubuntu 14.04):

/sbin/initctl 'reload-configuration'; stop bond-check; start bond-check

Then agent logs a couple of error lines:
Sep  1 10:18:01 m630-43 rudder[114618]: CFEngine(agent) rudder Finished command related to promiser '/sbin/initctl 'reload-configuration'; stop bond-check; start bond-check' -- an error occurred, returned 127
Sep  1 10:18:01 m630-43 rudder[114618]: CFEngine(agent) rudder Q: "...in/initctl 'rel": sh: 1: stop: not found#012Q: "...in/initctl 'rel": sh: 1: start: not found

when is running as daemon.

  • Note, that "rudder agent run -i" works ok.

Hooks looks like shell scripts and must to work in accordance with shell rules. Otherwise, limitations must be documented.
As for now, hooks text is scrubbing in obscure manner, and then executing selectively.
for example, in:

cat <<EOF > /path/to/file
  some line 1
other line
etc.
EOF

Spaces became broken.


Related issues 2 (1 open1 closed)

Related to Rudder - Enhancement #8473: Form fields in Directive edit are eating leading spaces.NewActions
Related to Rudder - Bug #15174: Rudder directives posthook can not support multilines command executionReleasedNicolas CHARLESActions
Actions

Also available in: Atom PDF