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

[debian] cobbler sync generated dhcpd.conf tries to run isc-dhcp-server but debian uses /usr/sbin/dhcpd #3690

Open
klin938 opened this issue May 4, 2024 · 0 comments
Labels
Bug Report Reporting a bug

Comments

@klin938
Copy link

klin938 commented May 4, 2024

Describe the bug

When running cobbler sync after editing dhcp.template, it tries to restart the dhcp service. On debian it expects the binary called isc-dhcp-server but it actually is /usr/sbin/dhcpd.

Steps to reproduce

  1. install cobbler
  2. enabled dhcp in setting, updated dhcp.template
  3. run cobbler sync

Expected behavior

dhcpd.conf generated correctly but it reported task failed:

running post-sync triggers
isc-dhcp-server path could not be found
Exception occurred: <class 'cobbler.cexceptions.CX'>
Exception value: 'Cobbler trigger failed: cobbler.modules.sync_post_restart_services'
Exception Info:
!!! TASK FAILED !!!

Cobbler version

Cobbler 3.4.0
  source: d944986a, Wed Apr 17 07:29:43 2024 +0200
  build time: Wed Sep 21 07:30:00 2022

Operating system

debian 12.5.0 bookworm

Cobbler log

[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - INFO | generating /etc/dhcp/dhcpd.conf
[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - INFO | cleaning link caches
[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - INFO | running post-sync triggers
[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - ERROR | isc-dhcp-server path could not be found
[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - INFO | Exception occurred: <class 'cobbler.cexceptions.CX'>
[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - INFO | Exception value: 'Cobbler trigger failed: cobbler.modules.sync_post_restart_services'
[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - INFO | Exception Info:
  File "/usr/lib/python3/dist-packages/cobbler/utils/thread.py", line 105, in run
    return_code = self._run(self)
                  ^^^^^^^^^^^^^^^

  File "/usr/lib/python3/dist-packages/cobbler/remote.py", line 286, in runner
    self.remote.api.sync(self.options.get("verbose", False), what=what)

  File "/usr/lib/python3/dist-packages/cobbler/api.py", line 1848, in sync
    sync_obj.run()

  File "/usr/lib/python3/dist-packages/cobbler/actions/sync.py", line 183, in run
    utils.run_triggers(self.api, None, "/var/lib/cobbler/triggers/sync/post/*")

  File "/usr/lib/python3/dist-packages/cobbler/utils/__init__.py", line 809, in run_triggers
    raise CX(f"Cobbler trigger failed: {module.__name__}")

[2024-05-04_162638_Sync_ece39064bb684131886d3a35fb6fb300] 2024-05-04T16:26:38 - ERROR | ### TASK FAILED ###

Additional information

Another symlink trick fixed the issue:

# ls -lart | grep dhcp
-rwxr-xr-x  1 root root        5842 Apr 17  2023 dhcp-lease-list
-rwxr-xr-x  1 root root     3169192 Apr 17  2023 dhcpd
lrwxrwxrwx  1 root root           5 May  4 16:33 isc-dhcp-server -> dhcpd

generating /etc/dhcp/dhcpd.conf
[2024-05-04_163930_Sync_a35e6f9e97db439d8124e393250a2d35]running post-sync triggers
running: ['/usr/sbin/isc-dhcp-server', '-4', '-t', '-q']
received on stdout:
running: ['systemctl', 'restart', 'isc-dhcp-server']
received on stdout:
*** TASK COMPLETE ***

We are building a new HPC cluster based on Debian, after patching the issues I reported (grub2-mkimage etc), cobbler works pretty well. We are very excited about it and will continue exploring it. :)

@klin938 klin938 added the Bug Report Reporting a bug label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Reporting a bug
Projects
Status: Todo
Development

No branches or pull requests

1 participant