GNU bug report logs -
#68675
[PATCH] Support dhcpcd in dhcp-client-service-type
Previous Next
Reported by: soeren <at> soeren-tempel.net
Date: Tue, 23 Jan 2024 16:14:01 UTC
Severity: normal
Tags: patch
Done: Sören Tempel <soeren <at> soeren-tempel.net>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 68675 <at> debbugs.gnu.org (full text, mbox):
Hi Sören,
Apologies for the late reply.
Sören Tempel <soeren <at> soeren-tempel.net> skribis:
> Ludovic Courtès <ludo <at> gnu.org> wrote:
>> Instead of calling ‘package-name’, which would prevent the use of
>> something other than a <package> record (such as an <inferior-package>)
>> or a package with a different name (like “dhcpcd-next”), what about
>> checking in the gexp which of /bin/dhclient and /bin/dhcpcd exists?
>
> I think I haven't fully grasped G-Expressions yet. I do understand how
> this would work inside the shepherd start gexp. However, I am not sure
> how I would check if /bin/dhclient or /bin/dhcpcd exist in the package
> within the dhcp-client-account-service since, at least as far as
> I understand, the dhcp-client-account-service is itself not a gexp.
I meant, within the ‘start’ method, something like:
(start #~(…
;; Check whether we’re dealing with ISC’s dhclient or dhcpcd.
(let ((type (if (file-exists?
(string-append #$package "/bin/dhclient"))
'isc-dhcp
'dhcpcd)))
(fork+exec-command …))))
Does that make sense?
>> That sounds quite complex. Surely there must be a way to force the name
>> of the PID file or to determine its name without running dhcpcd in a
>> pipe?
>
> Unfortunately, I don't think there is any way to force the PID file
> name. Furthermore, the pidfile path depends on the amount interfaces
> specified. If there is only one interface, a single dhcpcd instance is
> spawned and the pidfile refers to that. Otherwise, a management process
> is started and the pidfile refers to the management process [1].
>
> I think the best solution here would be to spawn dhcpcd as child process
> of GNU shepherd and have shepherd supervise it that way. I have a service
> doing that too, but its annoying to integrate with the existing dhclient
> service [2]. Maybe that's something we can migrate to in the long run.
What do others do? I guess it’s not possible to have a systemd .service
file given those PID file semantics, is it?
Thanks,
Ludo’.
This bug report was last modified 76 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.