forked from chimera-linux/dinit-chimera
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshutdown-hook
More file actions
34 lines (29 loc) · 886 Bytes
/
shutdown-hook
File metadata and controls
34 lines (29 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# run after all services have shut down and
# remaining processes have been terminated
#
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
# assume proper directory
cd @EARLY_PATH@/..
if [ ! -e /run/dinit/container ]; then
echo "Disabling swap..."
./early/scripts/swap.sh stop
echo "Unmounting network filesystems..."
umount -l -a -t nfs,nfs4,smbfs,cifs
umount -l -a -O netdev
echo "Unmounting filesystems..."
./early/scripts/fs-fstab.sh stop
echo "Remounting root read-only..."
./early/helpers/mnt rmnt / ro
fi
sync
if [ ! -e /run/dinit/container ]; then
export DM_DISABLE_UDEV=1
echo "Deactivating cryptdisks..."
./early/scripts/cryptdisks.sh remaining stop
echo "Deactivating volume groups..."
./early/scripts/lvm.sh stop
echo "Deactivating remaining cryptdisks..."
./early/scripts/cryptdisks.sh early stop
fi