mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
udevil: mount by systemd service
... or fuse fails with systemd and cgroups in kernel. no long runing tasks should ever be started from udev rules
This commit is contained in:
parent
3ec7748d63
commit
61824e5326
@ -52,3 +52,7 @@ post_makeinstall_target() {
|
|||||||
mkdir -p $INSTALL/usr/bin
|
mkdir -p $INSTALL/usr/bin
|
||||||
cp -PR src/udevil $INSTALL/usr/bin
|
cp -PR src/udevil $INSTALL/usr/bin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
enable_service udevil-mount@.service
|
||||||
|
}
|
||||||
|
8
packages/sysutils/udevil/system.d/udevil-mount@.service
Normal file
8
packages/sysutils/udevil/system.d/udevil-mount@.service
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Udevil mount service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/udevil --mount %I
|
||||||
|
ExecStop=/usr/bin/udevil --umount %I
|
||||||
|
RemainAfterExit=yes
|
@ -12,13 +12,13 @@ GOTO="exit"
|
|||||||
|
|
||||||
# mount or umount for hdds
|
# mount or umount for hdds
|
||||||
LABEL="harddisk"
|
LABEL="harddisk"
|
||||||
ACTION=="add", RUN+="/usr/bin/udevil --mount /dev/%k"
|
ACTION=="add", RUN+="/bin/systemctl restart udevil-mount@/dev/%k.service"
|
||||||
ACTION=="remove", RUN+="/usr/bin/udevil --umount /dev/%k"
|
ACTION=="remove", RUN+="/bin/systemctl stop udevil-mount@/dev/%k.service"
|
||||||
GOTO="exit"
|
GOTO="exit"
|
||||||
|
|
||||||
# mount or umount for opticals
|
# mount or umount for opticals
|
||||||
LABEL="optical"
|
LABEL="optical"
|
||||||
ACTION=="add|change", RUN+="/usr/bin/udevil --umount /dev/%k", RUN+="/usr/bin/udevil --mount /dev/%k"
|
ACTION=="add|change", RUN+="/bin/systemctl restart udevil-mount@/dev/%k.service"
|
||||||
GOTO="exit"
|
GOTO="exit"
|
||||||
|
|
||||||
# Exit
|
# Exit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user