FS#60310 - [dhcpcd] Hooks dir should be changed

Attached to Project: Arch Linux
Opened by Kim Scarborough (chowbok) - Thursday, 04 October 2018, 23:27 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:23 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To David Runge (dvzrv)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently, dhcpcd hook scripts need to be added to /usr/lib/dhcpcd/dhcpcd-hooks/, and also edited there if changes are needed. This doesn't seem to be in keeping with standard Arch practice. Can HOOKDIR be changed in Makefile.inc to /etc/dhcpcd-hooks? (Note that you can't just change the libexec location configure argument, as this also controls the location of the dhcpcd-run-hooks.)
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:23 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/dhcpcd/issues/1
Comment by Kim Scarborough (chowbok) - Thursday, 04 October 2018, 23:28 GMT
"controls the location of the dhcpcd-run-hooks script", I meant to type.
Comment by Doug Newgard (Scimmia) - Monday, 08 October 2018, 06:12 GMT
The man page indicates that /etc/dhcpcd.enter-hook should be used for this.
Comment by Kim Scarborough (chowbok) - Monday, 08 October 2018, 15:44 GMT
That won't work for changing the location of the included hooks, only for defining variables and custom hooks.
Comment by Doug Newgard (Scimmia) - Monday, 08 October 2018, 16:06 GMT
of course it won't work for "changing the location of the included hooks". Nobody suggested that. You can normally override things like this by providing a hook with the same name in /etc. Does that not work?
Comment by Kim Scarborough (chowbok) - Monday, 08 October 2018, 16:49 GMT
No, I don't think that will work, because some hooks have to run before or after particular defined hooks. Right now as it's configured, it runs hook scripts in the following order:

/etc/dhcpcd.enter-hook
/usr/lib/dhcpcd/dhcpcd-hooks/*
/etc/dhcpcd.exit-hook

So if you want to run an extra hook, say the wpa_supplicant hook, you have to copy or symlink it to /usr/lib/dhcpcd/dhcpcd-hooks/. It seems to me that we should avoid having to edit things in /usr/lib, and it's pretty easy to redefine the one variable so that the hooks directory is in /etc/dhcpcd-hooks instead.
Comment by Roy Marples (rsmarples) - Saturday, 05 January 2019, 10:47 GMT
You could do this in /etc/dhcpcd.enter-hook

# Run the wpa_supplicant hook
. /usr/lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant

But really, I only wrote the wpa_supplicant hook because wpa_supplicant didn't have a means of hotplugging interfaces - so I fixed wpa_supplicant.
Starting with wpa_supplicant-2.6 it can be compiled with CONFIG_MATCH_IFACE (no idea if this is enabled in Arch). It can then be started like so:
wpa_supplicant -B -M -c/etc/wpa_supplicant.conf

And voila, wpa_supplicant hot plugs all wireless interfaces from one config file, giving you the same functionality as the dhcpcd hook.
Comment by Kim Scarborough (chowbok) - Monday, 29 July 2019, 01:26 GMT
Okay, but that's just one hook. There are others. I still say that non-packaged files and symlinks shouldn't end up in /usr/lib.
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...