1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-25 12:58:35 -06:00

new: Added autofs-fix-lag*

This commit is contained in:
Sayantan Santra 2023-07-26 17:21:22 -05:00
parent 8b8d13bb41
commit 16eb2379cd
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
3 changed files with 29 additions and 1 deletions

View file

@ -1,4 +1,4 @@
![Number of scripts](https://img.shields.io/badge/number_of_scripts-36-blue)
![Number of scripts](https://img.shields.io/badge/number_of_scripts-38-blue)
# Random Scripts
This repository is for random scripts I wrote mostly for personal use.

7
autofs-fix-lag-login.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# This script is needed to start autofs at login, in case I'm switching users.
# I add this as a login script in KDE.
# Look at autofs-fix-lag-logout.sh for more info.
systemctl start autofs

21
autofs-fix-lag-logout.sh Normal file
View file

@ -0,0 +1,21 @@
#!/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