Adrian Bolzan wrote:
> hello, all!
>
> i recently reported a problem with setting up my swapfile and it was
> suggested i e-mail my /etc/rc.d/init.d/swap script. i have also included
> my /etc/fstab file for completeness.
>
> do these look correct?
>
> the problem is that no disk space is allocated to my swapfile as reported
> by the 'free' command.
>
> thanks for any help.
>
> adrian b.
>
> and so without any further ado...
>
> --------
> /etc/rc.d/init.d/swap:
>
> #!/bin/sh
> #
> # swap This shell script takes care of starting and stopping
> # swap.
> #
> # chkconfig: 2345 80 30
> # description: Turns on and off SwapFile
> # Author: Adrian Bolzan
> # date: 20/9/98
>
> # Source function library.
> . /etc/rc.d/init.d/functions
>
> # Checking that swapon and swapoff are there.
> [ -f /sbin/swapon ] || exit 0
> [ -f /sbin/swapoff ] || exit 0
>
> # Checking that the swapfile exists.
> [ -f /home/SwapDir/SwapFile ] || exit 0
>
> # See how we were called.
> case "$1" in
> start)
> # Start swap.
> echo -n "Starting swap. "
> [ -f /var/lock/subsys/swap ] || exit 0
> /sbin/swapon -a
> echo
> touch /var/lock/subsys/swap
> ;;
> stop)
> # Stop daemons.
> echo -n "Shutting down swap. "
> /sbin/swapoff -a
> echo
> rm -f /var/lock/subsys/swap
> ;;
> restart)
> $0 stop
> $0 start
> ;;
> status)
> status swap
> ;;
> *)
> echo "Usage: swap {start|stop|restart|status}"
> exit 1
> esac
>
> exit 0
>
> -------
>
> and fstab:
>
> /dev/hda4 / ext2 defaults 1 1
> /dev/hda3 /home ext2 defaults 2 2
> /home/SwapDir/SwapFile none swap sw 0 0
> /dev/hda1 /mnt/drive-c vfat user,noauto,ro 0 0
> /dev/hda5 /mnt/drive-d vfat user,noauto,ro 0 0
> /dev/fd0 /mnt/floppy ext2 user,noauto 0 0
> /dev/fd0 /mnt/win_floppy vfat user,noauto 0 0
> /dev/fd0 /home/adrian/win_floppy vfat user,noauto 0 0
> /dev/cdrom /mnt/cdrom iso9660 user,noauto,ro 0 0
> none /proc proc defaults 0 0
>
> -----------------------------------------------
>
> thanks for any help.
>
> adrian b.
>
> -------------------------------------
> Adrian Bolzan
> c/- Dept of Chemistry
> The University of Queensland
> Brisbane 4072 Australia
> Ph: +61 (7) 3365-2281 or 3365-3527
> Fax: +61 (7) 3365-4299
Hi Adrian,
try replacing the "none" in /etc/fstab, third line, second column, with
"swap".
HTH.
--
See you,
Christoph Hammann
#########################################################
# (-; too freaking busy feigning computer literacy ;-) #
#######################################################