source: bootscripts-embedded/clfs/rc.d/shutdown@ 6bbb1f0

Last change on this file since 6bbb1f0 was 6bbb1f0, checked in by Andrew Bradford <andrew@…>, 11 years ago

shutdown: Only swapoff if fstab exists

Or else swapoff complains about lack of fstab and apparently can't find
where swap is.

  • Property mode set to 100755
File size: 601 bytes
RevLine 
[97ad60e]1#!/bin/ash
2
3# System Shutdown Script
4#
5
6. /etc/rc.d/init.d/functions
7
8echo
9echo "System is going down for reboot or halt now."
10echo
11
[292c832]12
[97ad60e]13echo "Starting stop scripts."
14
[292c832]15for i in /etc/rc.d/stop/*
16do
17 if [ -x $i ]; then
18 $i stop
19 fi
[97ad60e]20done
21
[292c832]22if [ -x /sbin/hwclock ] && [ -e /dev/rtc ]; then
[5c79e0a]23 echo -n "Syncing system clock to hardware clock: "
[292c832]24 hwclock --systohc --utc
25 check_status
26fi
[97ad60e]27
[6bbb1f0]28if [ -x /sbin/swapoff ] && [ -s /etc/fstab ]; then
[292c832]29 echo -n "Disabling swap space: "
30 swapoff -a
31 check_status
32fi
[97ad60e]33
34echo -n "Syncing all filesystems: "
35sync
36check_status
37
38echo -n "Unmounting all filesystems: "
39umount -a -r
[292c832]40
Note: See TracBrowser for help on using the repository browser.