devd: autofs: Move autofs related events to a separate file

If a user don't have FreeBSD-autofs installed there is no need to try calling
automount on every GEOM event.
It's also easier to add/delete autofs related event in a separate file.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D42495
Reviewed by:	imp
This commit is contained in:
Emmanuel Vadot 2023-11-07 11:06:15 +01:00
parent 5a78fcfce4
commit b3c116d50e
3 changed files with 14 additions and 7 deletions

View file

@ -11,6 +11,11 @@ DEVDDIR= /etc/devd
DEVD+= asus.conf
.endif
CONFGROUPS+= AUTOFS
AUTOFSDIR= ${DEVDDIR}
AUTOFS+= autofs.conf
AUTOFSPACKAGE= autofs
CONFGROUPS+= DHCLIENT
DHCLIENTDIR= ${DEVDDIR}
DHCLIENT+= dhclient.conf

9
sbin/devd/autofs.conf Normal file
View file

@ -0,0 +1,9 @@
#
# autofs(5) specific devd events
# Discard autofs caches, useful for the -media special map.
notify 100 {
match "system" "GEOM";
match "subsystem" "DEV";
action "/usr/sbin/automount -c";
};

View file

@ -136,13 +136,6 @@ notify 0 {
action "service postgresql restart";
};
# Discard autofs caches, useful for the -media special map.
notify 100 {
match "system" "GEOM";
match "subsystem" "DEV";
action "/usr/sbin/automount -c";
};
# Handle userland coredumps.
# This commented out handler makes it possible to run an
# automated debugging session after the core dump is generated.