Project

General

Profile

Bug #15697

Command not found when running "rudder agent enable -s"

Added by Philip Seeger 2 months ago. Updated about 1 month ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Severity:
User visibility:
Effort required:
Priority:
0

Description

Rudder fails to re-enable and start the agent in some cases.

# rudder agent enable -s
/opt/rudder/share/commands/../lib/common.sh: line 44: service: command not found

Bug #1: The systemd detection fails:

# systemctl list-units --type service --all ${service}.service 2>&1 | grep -q "^${service}.service"; echo $?
1
# systemctl list-units --type service --all ${service}.service 2>&1 
  UNIT           LOAD   ACTIVE SUB    DESCRIPTION
● rudder.service loaded failed failed LSB: Rudder server

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

Bug #2: The "service" compatibility wrapper is detected but not executed.

Associated revisions

Revision e939b70f (diff)
Added by Philip Seeger 2 months ago

Fixes #15697: Fix systemd detection and prevent service: command not found error

History

#1

Updated by Philip Seeger 2 months ago

  • Target version set to 5.0.14
#2

Updated by Philip Seeger 2 months ago

As for #2:

# $SSH $HOST rudder agent start
/opt/rudder/share/commands/../lib/common.sh: line 46: service: command not found
error: start service rudder-agent failed
# $SSH $HOST PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin rudder agent start
ok: start service rudder-agent succeeded

I was going to use your rudder-dev script to provide a fix but it keeps failing atm.

#3

Updated by Philip Seeger 2 months ago

  • Pull Request set to https://github.com/Normation/rudder-agent/pull/248/commits/14076bd3d8032835cdf971c67aae032fe28dc8bb
#4

Updated by Alexis MOUSSET 2 months ago

  • Description updated (diff)
#5

Updated by Benoît PECCATTE 2 months ago

I was going to use your rudder-dev script to provide a fix but it keeps failing atm.

I'm interested in the failure, I'm willing to fix it.
Can you tell me more about the problem ?

#6

Updated by Alexis MOUSSET 2 months ago

  • Category set to Agent
  • Status changed from New to Pending technical review
  • Assignee set to Alexis MOUSSET
#7

Updated by Philip Seeger 2 months ago

Hi Benoît. I should note that I haven't used that script previously, so it's likely that I'm using it wrong. After installing some missing dependencies and completing the config file, the branch command failed with a backtrace and (I believe; haven't saved the output) "No JSON object could be decoded".

#8

Updated by Benoît PECCATTE 2 months ago

This error happens when the redmine token in the configuration file is not valid, I should replace this with an error message

#9

Updated by Benoît PECCATTE 2 months ago

rudder-dev stack trace fixed by #15699

#10

Updated by Philip Seeger 2 months ago

  • Status changed from Pending technical review to Pending release
#12

Updated by Alexis MOUSSET about 1 month ago

  • Subject changed from rudder agent enable -s: /opt/rudder/share/commands/../lib/common.sh: line 44: service: command not found to Command not found when running "rudder agent enable -s"
#13

Updated by Vincent MEMBRÉ about 1 month ago

  • Status changed from Pending release to Released

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

Also available in: Atom PDF