Add timeout to volume unlock/mount

This commit is contained in:
Alexandre CATTEAU 2023-07-26 20:33:36 +02:00
parent 0617349573
commit a5c0b46cd8
3 changed files with 7 additions and 2 deletions

View File

@ -8,7 +8,6 @@ What=/dev/mapper/lecrypt
Where=/etc/letsencrypt
Type=ext4
Options=rw,relatime
TimeoutSec=45
[Install]
WantedBy=default.target

View File

@ -17,6 +17,10 @@ fi
echo "Copying Systemd units and drop-ins to system directory..."
$sudo cp $run_directory/etc-letsencrypt.mount /etc/systemd/system/
if [ ! -d /etc/systemd/systemd-cryptsetup@lecrypt.service.d ]; then
$sudo mkdir /etc/systemd/system/systemd-cryptsetup@lecrypt.service.d
fi
$sudo cp $run_directory/timeout.conf /etc/systemd/system/systemd-cryptsetup@lecrypt/
if [ ! -d /etc/systemd/system/nginx.service.d ]; then
$sudo mkdir /etc/systemd/system/nginx.service.d
fi
@ -26,7 +30,7 @@ echo "Reloading Systemd..."
$sudo systemctl daemon-reload
echo "Enabling etc-letsencrypt.mount..."
$sudo systemctl enable etc-letsencrypt.mount
# WARNING you should enable this mount (and keep nginx.service enabled) if your volume does not unlock automatically
# WARNING you should enable this mount (and keep nginx.service disabled) if your volume does not unlock automatically
echo "Finished install. Exiting..."
exit 0

2
timeout.conf Normal file
View File

@ -0,0 +1,2 @@
[Unit]
JobTimeoutSec=30