Project

General

Profile

Bug #9950

User story #8353: Implement notifications for different server-side actions and events (hooks)

Policy generation fails in 4.1 with 'kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]'

Added by Nicolas CHARLES 11 months ago. Updated 11 months ago.

Status:
Released
Priority:
N/A
Category:
System integration
Target version:
Target version (plugin):
Severity:
User visibility:
Effort required:
Priority:

Description

When doing a policy generation on Centos6, I get the following error

⇨ Policy update error for process '3' at 2017-01-11 09:35:42
⇨ Exit code=1 for hook: '/opt/rudder/etc/hooks.d/policy-generation-finished/50-sigup-cf-serverd HookParameter(RUDDER_GENERATION_DATETIME,2017-01-11T09:35:39.234Z) HookParameter(RUDDER_END_GENERATION_DATETIME,2017-01-11T09:35:42.619Z) HookParameter(RUDDER_NODEIDS,root) HookParameter(RUDDER_NUMBER_NODES_UPDATED,1) HookParameter(RUDDER_ROOT_POLICY_SERVER_UPDATED,0)'. Stdout: '' Stderr: 'which: no killall in ((null)) kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] '

Issue is: it calls /opt/rudder/etc/hooks.d/policy-generation-finished/50-sigup-cf-serverd, which calls /opt/rudder/bin/rudder-reload-cf-serverd

Somehow, /opt/rudder/bin/rudder-reload-cf-serverd doesn't know that "killall" is there (probably no PATH available for the webapp)), so it falls back to

kill -1 $(pidof cf-serverd 2>/dev/null)

however, pidof cf-serverd returns nothing if it not running, so kill fails, and worse, pidof isn't in the PATH either

Replacing pidof by it path or killall by its path solves the issue, but I'm pretty sure it should rather have the PATH defined

Associated revisions

Revision e8977162
Added by François ARMAND 11 months ago

Fixes #9950: Policy generation fails in 4.1 with 'kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]'

History

#1 Updated by Benoît PECCATTE 11 months ago

  • Assignee changed from Alexis MOUSSET to François ARMAND

This is what happed when the PATH is not defined.

We should have inherited the proper environment to be able to run a script.

#2 Updated by François ARMAND 11 months ago

  • Status changed from New to In progress

#3 Updated by François ARMAND 11 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/1445

#4 Updated by François ARMAND 11 months ago

  • Assignee changed from Vincent MEMBRÉ to Alexis MOUSSET

#5 Updated by François ARMAND 11 months ago

  • Assignee changed from Alexis MOUSSET to Vincent MEMBRÉ

#6 Updated by François ARMAND 11 months ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

#7 Updated by Vincent MEMBRÉ 11 months ago

  • Parent task set to #8353

#8 Updated by Vincent MEMBRÉ 11 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 4.1.0 which was released today.

Also available in: Atom PDF