1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 21:18:36 -06:00
random/autofs-fix-lag-logout.sh

22 lines
828 B
Bash
Raw Normal View History

2023-07-26 17:21:22 -05:00
#!/bin/sh
# This script is needed to stop autofs at logout so that it's stopped before
# network is down and does not cause delay in shutdown or reboot.
# I run this as a logout script from KDE. We need to make sure that password
# isn't needed to stop autofs. For that, create this file.
# /etc/polkit-1/rules.d/autofs-service.rules
# -------------------------------------------
# polkit.addRule(function(action, subject) {
# if (action.id == "org.freedesktop.systemd1.manage-units" &&
# subject.isInGroup("usergroup")) {
# if (action.lookup("unit") == "autofs.service") {
# var verb = action.lookup("verb");
# if (verb == "start" || verb == "stop" || verb == "restart") {
# return polkit.Result.YES;
# }
# }
# }
# });
systemctl stop autofs