Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | ### BEGIN INIT INFO |
| 3 | # Provides: umountfs |
| 4 | # Required-Start: |
| 5 | # Required-Stop: |
| 6 | # Default-Start: |
| 7 | # Default-Stop: 0 6 |
| 8 | # Short-Description: Turn off swap and unmount all local file systems. |
| 9 | # Description: |
| 10 | ### END INIT INFO |
| 11 | |
| 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
| 13 | |
| 14 | echo "Deactivating swap..." |
| 15 | swapoff -a |
| 16 | |
| 17 | # We leave /proc mounted. |
| 18 | echo "Unmounting local filesystems..." |
| 19 | grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram |
| 20 | mount -o remount,ro / |
| 21 | |
| 22 | umount -f -a -r > /dev/null 2>&1 |
| 23 | |
| 24 | : exit 0 |