rudder agent factory-reset bugs
1) The -f option is never evaluated
It's initialized to 0 but your getopts parser misses support for -f.
It was definitely not tested when the ctrl-c / -f bits were introduced.
Further, there's some more bugs / bad handling:
@[root@dhcp215 ~]# /etc/one-context.d/60-rudder-polserv
grep: /var/rudder/cfengine-community/policy_server.dat: No such file or directory
/opt/rudder/share/commands/agent-factory-reset: line 55: [: =: unary operator expected
Reinitializing a node removes its UUID, its keys and its associated directives!
Do yo really want to do it?
Type ctrl-c to abort now or enter to continue
cp: cannot stat ‘/opt/rudder/etc/uuid.hive’: No such file or directory@
#7 Updated by Alexis MOUSSET about 1 year ago
- Status changed from In progress to Pending technical review
- Assignee changed from Alexis MOUSSET to Benoît PECCATTE
- Pull Request set to https://github.com/Normation/rudder-agent/pull/126
#8 Updated by Alexis MOUSSET about 1 year ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder-agent|d59cfe49617808025d3dcefd8941e4196999e931.
#9 Updated by Vincent MEMBRÉ about 1 year ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 4.1.6 and 4.2.0~beta3 which were released today.
- 4.1.6: Announce Changelog
- 4.2.0~beta3: Announce Changelog
- Download: https://www.rudder-project.org/site/get-rudder/downloads/