Adding a script to the /etc/rc.d/rc#.d/ directory with either an S or K prefix, adds the script to the boot or shutdown process. The scripts are run in numerical order. S20abc is run before S30xyz. The extensibility to the boot and shutdown procedures of the operating system is one of the strengths of UNIX. The orderly sequential initiation of processes can be coordinated for dependent processes. The orderly shutdown of processes is often required of …
Results > Posts Filed Under > Knowledge Base
How to Enable scripts and services on startup
Restricting CRON and AT in Redhat, Fedora & CentOS.
Sometimes you want the root user or other trusted users to be able to run cronjobs or timed scripts with at. In order to lock these down, you will need to create a cron.deny and at.deny file inside /etc with the names of all blocked users. An easy way to do this is to parse /etc/passwd. The script below will do this for you.
echo “Locking down Cron”
touch /etc/cron.allow
chmod 600 /etc/cron.allow
awk -F: ‘{print $1}’ /etc/passwd | grep -v root > /etc/cron.deny
echo …
change speed of network card, find speed of network card, mii-tool, ethtool
Task: Find full or half duplex speed
You can use dmesg command to find out your duplex mode:
# dmesg | grep -i duplex
Output:
eth0: link up, 100Mbps, full-duplex, lpa 0×45E1
ethtool command
Uss ethtool to display or change ethernet card settings. To display duplex speed, enter:
# ethtool eth1
Output:
Settings for eth1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 10Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: g
Current message level: 0×00000007 (7)
Link detected: yes
mii-tool …
Setting cpu affinity for a certain task in Linux, cpu affinity
If you are running 4 servers assuming you are using Dual Xeon processors ( classed as 4 cpu’s in linux)
Server 1 uses 60% CPU Usage
Server 2 Uses 60% CPU Usage
Server 3 Uses 20% CPU Usage
Server 4 Uses 20% CPU Usage
Rather than letting the distro automtically assign CPU’s it is sometimes better for you to do it manually. In this instance it would make server to have
Server 1 using CPU0
Server 2 using CPU1
Server 3 + 4 using CPU2
Leaving you with a …