Repository navigation
fix: reload systemd after crypttab changes - #688
bataroland wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
CI tests do not run automatically on pull requests. A role repository See GitHub CI testing using /citest Run every available CI workflow: Run the linting and other lightweight checks: Run the integration tests (QEMU/container and Testing Farm): Run one or more selected workflows by separating their names with spaces:
Post another |
|
/citest all |
bataroland
left a comment
There was a problem hiding this comment.
Thanks for running CI. On Fedora 44, Fedora 45 and CentOS Stream 9, tests_luks2.yml passed: immediately after the first role invocation, the new cryptsetup unit had LoadState=loaded and SourcePath=/etc/crypttab, without another reload or role run.
The four new unit tests also passed. The eight Python 3.9 failures are the same get_format failures seen on the unmodified base. Both Fedora QEMU jobs failed during Stratis package removal; the first CentOS 9 QEMU failure was a RAID test where the kernel could not reread the partition table.
I couldn't access the detailed Testing Farm logs. Could you share the first failing task and its error from one of those runs so we can check whether it involves the crypttab reload?
|
/citest all |
Include linux-system-roles#688 so the role's crypttab entry is visible to systemd before linux-system-roles#686 inspects the generated unit. Keep the original reload commit in the history of both branches. Assisted-by: OpenCode using model GPT-6.2 Astra Signed-off-by: Bata Roland Krisztián <batarolandkrisztian@gmail.com>
Include linux-system-roles#688 so the role's crypttab entry is visible to systemd before linux-system-roles#686 inspects the generated unit. Keep the original reload commit in the history of both branches. Assisted-by: OpenCode using model GPT-6.2 Astra Signed-off-by: Bata Roland Krisztián <batarolandkrisztian@gmail.com>
Keep the shared first-invocation test in sync with linux-system-roles#688. Assisted-by: OpenCode using model GPT-6.2 Astra Signed-off-by: Bata Roland Krisztián <batarolandkrisztian@gmail.com>
bataroland
left a comment
There was a problem hiding this comment.
@richm I traced the CentOS 7 test failure to systemd-escape --template: stock systemd 219 rejects systemd-cryptsetup@.service. Fixed in 3ce172d by escaping just the mapper name and using the result as the unit instance. The test still checks LoadState=loaded and SourcePath=/etc/crypttab after the first role invocation, without a manual reload. #686 includes the same commit. Could you rerun CI on 3ce172d?
|
/citest all |
bataroland
left a comment
There was a problem hiding this comment.
@spetrosi, could you run /citest all on 3b11e27? I merged main (25c3070) to pick up #692, #693 and #698. All 66 unit tests passed locally on Python 3.9 with the merged tree.
In the previous full run, the first-run crypttab assertion passed in all seven Testing Farm environments, including CentOS 7. Before any role rerun or manual reload, systemd reported LoadState=loaded and SourcePath=/etc/crypttab. The EL7 LVM pool-member failure tracked in #697 and the Fedora Testing Farm Stratis JSON error also occurred without this PR.
Move the existing final daemon-reload after crypttab management. Preserve mount-driven reloads and the earlier pre-mount reload, and also refresh systemd when crypttab changes without mount entries. Keep native check-mode behavior. Assert generated-unit availability immediately after the first encrypted-volume creation, before any rerun or manual reload. Add four Python-2-compatible role-contract tests for ordering, change detection and check mode. No module, handler or public API changes. Assisted-by: OpenCode using model GPT-6.1 Sol Signed-off-by: Bata Roland Krisztián <batarolandkrisztian@gmail.com>
systemd 219 rejects the cryptsetup template in systemd-escape. Escape only the mapper name, then use it in the fixed service template. Keep the first-invocation LoadState and SourcePath assertions intact. Assisted-by: OpenCode using model GPT-6.2 Astra Signed-off-by: Bata Roland Krisztián <batarolandkrisztian@gmail.com>
3b11e27 to
47ee3fe
Compare
Enhancement:
Make crypttab changes visible to systemd before the storage role returns.
Reason:
Both daemon-reloads currently precede crypttab updates. After creating the first
encrypted volume, its cryptsetup unit can remain absent until a later role run.
That later reload changes the runtime dependency graph even with
changed=0.Crypttab-only changes with no mount entries also need a reload.
Result:
crypttab result. Preserve mount-driven reloads and also reload on a crypttab
change. Keep native check-mode behavior and the earlier pre-mount reload.
reloading or rerunning the role, plus four Python-2-compatible contract tests.
systemd219), escape the mapper name and add the fixed serviceprefix/suffix instead of passing a template to
systemd-escape. The teststill requires
LoadState=loadedandSourcePath=/etc/crypttab.Validation:
fails the new ordering/change assertions.
systemd-219-78.el7: the old template invocationreturned exit code 1; escaping the same mapper name alone succeeded and
produced the expected service name.
mainat f56a4df (including test: mock get_format to fix failing python unit tests #692), all 66 unittests pass on Python 2.7, 3.9 and 3.10.
assertion. Targeted candidate role checks pass creation with and without mount
entries, check mode on blank volumes, normal/check data/header/mount/unit
preservation, and removal of stale generated dependencies. Existing volume,
LUKS-header, mount and cryptsetup-unit snapshots are unchanged after cleanup.
Tested with Blivet 3.14.2, systemd 259.9 and ansible-core 2.21.5.
run locally. Upstream CI for the current head has not been verified.
Assisted-by: OpenCode using models GPT-6.1 Sol, GPT-6.2 Astra
Signed-off-by: Bata Roland Krisztián batarolandkrisztian@gmail.com
Issue Tracker Tickets (Jira or BZ if any): None.