Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix systemd version recognizing in cgroup hook #2631

Merged
merged 1 commit into from
May 24, 2024

Conversation

vchlum
Copy link
Contributor

@vchlum vchlum commented Mar 12, 2024

Describe Bug or Feature

The systemd version in cgroup hook is not recognized on miscellaneous systems:

(BULLSEYE)root@torque4:~# grep "systemd version seems to be" /var/spool/pbs/mom_logs/20240312 
03/12/2024 09:54:39;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 09:56:40;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0

and the cgroups service pbs_jobs.service is not started on mom.

The command called to get the systemd version is systemctl --system show --property=Version.

See the result on miscellaneous systems:

(BULLSEYE)root@torque4:~# systemctl --system show --property=Version
Version=247.3-7+deb11u4
[root@almalinux ~]# systemctl --system show --property=Version
Version=252-18.el9

but the parsing regex r'Version=\D*(\d+)' lacks the string after major version number. The systemd version is not recognized in such cases.

Describe Your Change

Change the parsing regex to ignore any string after major version number.

Link to Design Doc

Attach Test and Valgrind Logs/Output

Manual test:
After the fix and importing a new version of the hook, the version is recognized, and the service started:

(BULLSEYE)root@torque4:~# grep "systemd version seems to be" /var/spool/pbs/mom_logs/20240312 
03/12/2024 09:54:39;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 09:56:40;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 09:57:29;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 09:57:30;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 09:59:30;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 10:01:32;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 10:03:33;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 10:05:34;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 10:07:35;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 10:09:37;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 10:11:38;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 0
03/12/2024 10:13:39;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 247
03/12/2024 10:14:43;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 247
03/12/2024 10:14:43;0800;pbs_python;Hook;pbs_python;__init__: systemd version seems to be 247
(BULLSEYE)root@torque4:~# systemctl status  pbs_jobs.service 
● pbs_jobs.service - PBS Pro job parent service
     Loaded: loaded (/run/systemd/system/pbs_jobs.service; static)
     Active: active (running) since Tue 2024-03-12 10:14:43 CET; 17s ago
   Main PID: 2112267 (sleep)
      Tasks: 1
     CGroup: /pbs_jobs.service
             └─2112267 /bin/sleep infinity

Mar 12 10:14:43 torque4.grid.cesnet.cz systemd[1]: Started PBS Pro job parent service.

Copy link
Contributor

@bayucan bayucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

Copy link
Contributor

@SudeshnaMoulik SudeshnaMoulik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this MR @vchlum

@bayucan bayucan merged commit 0aa5fb3 into openpbs:master May 24, 2024
6 checks passed
@vchlum vchlum deleted the cgroups_systemd_version branch May 24, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants