Skip to content

Commit

Permalink
Fixed failed to open /dev/tty errors when using systemd unit management
Browse files Browse the repository at this point in the history
When enabling systemd unit management with the augment, e.g.:

{
  "classes": {
    "default:mpf_enable_cfengine_systemd_component_management": {
        "regular_expressions": [ "any" ]
    }
  }
}

There were errors like failed to open /dev/tty no such device.

Providing --no-ask-password solves the issue.

Ticket: CFE-4445
Changelog: title
  • Loading branch information
craigcomstock committed Oct 14, 2024
1 parent d94cee3 commit 1763475
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cfe_internal/update/systemd_units.cf
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ bundle agent cfe_internal_systemd_unit_files
systemd::

"$(systemctl)"
args => "daemon-reload",
args => "daemon-reload --no-ask-password",
handle => "cfe_internal_systemd_unit_files_reload_when_changed",
if => classmatch("cfe_systemd_service_unit_.*_repaired"),
comment => "We need to reload the systemd configuration after any unit
is changed in order for systemd to recognize the change.";

"$(systemctl)"
args => "restart $(service_units).service",
args => "restart $(service_units).service --no-ask-password",
handle => "cfe_internal_systemd_unit_restart_when_changed",
if => and(classify("cfe_systemd_service_unit_$(service_units)_repaired"),
returnszero("$(systemctl) --quiet is-active $(service_units)", noshell)),
Expand Down

0 comments on commit 1763475

Please sign in to comment.