12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using the /proc Directory 425. /proc/net/: Directory containing network settings.. /proc/irq/: Directories contain a subdirectory for each used IRQ, with the subdirectorycontaining information about the specific IRQ.21Using sysctl to Change ValuesIt is also possible to use the virtual /proc filesystem to change how the kernel behaves.The value of some files can be changed by redirecting data into it such as echo 1 >/proc/sys/net/ipv4/ip_forward to enable IP forwarding. However, these values are notpersistent after a reboot.To modify the values of the virtual files in /proc/sys/, the sysctl command can also beused by the root user to modify and test the values. Again, these changes are only useduntil the system is rebooted. To make the values persist between reboots, modify the/etc/sysctl.conf file as root. Changes to this file do not take place immediately. Eitheruse the sysctl -p command to enable all changes in the file or echo the new values intothe appropriate /proc file for the changes to take place immediately.To retrieve a list of all values that can be modified in this manner, execute the sysctl -acommand. Notice that the type of value each parameter is set to differs. Be extremelycareful to set these parameters to proper values and test them before setting them onproduction systems. It is possible to lock up the system or cause severe system performanceissues if incorrect values are given to them.To map the parameters listed with the sysctl -a command to the virtual file locations,replace each dot (.) with a forward slash (/) and pre-pend the results with /proc/sys/.For example, the kernel.exec-shield parameter maps to the /proc/sys/kernel/exec-shield file.TIPTo list the /proc/sys/ tunables for a specific function such as virtual memory, usegrep to only show those options and redirect it into a file:systctl -a | grep vm > vm-tunables.txtTo use the sysctl command-line utility to assign values to these kernel parameters, usethe following syntax as the root user:sysctl -w =””Changes can be saved for subsequent reboots by adding them to the /etc/sysctl.conffile with the following syntax: =

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!