swapon at bootup

Right now I do my swapon command manually after bootup.
In what file would I place this command to get the swap
activated automatically at boot?
jaandersAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
timcConnect With a Mentor Commented:
It may depend on your flavour of Linux.

Using SysV style inits, the /etc/rc.d/rc.sysinit script contains some lines just after the network configuration call which say:

# Start up swapping.
echo "Activating swap partitions"
swapon -a

This is typical of your RedHat Linux's ...

If it's Slackware, perhaps look in /etc/rc.d/rc.S.  After the path statement, you can swapon there, e.g.

#!/bin/sh
#
# /etc/rc.d/rc.S:  System initialization script.
#

PATH=/sbin:/usr/sbin:/bin:/usr/bin

# enable swapping
/sbin/swapon -a

 etc ...

Does that help?

0
All Courses

From novice to tech pro — start learning today.