Tuesday, December 4, 2012

Oracle Enterprise Manager on EC2 - IP address change after reboot


The script (/usr/local/bin/sethostname) to be run by cron:

·        Login as root.
·        vi /usr/local/bin/sethostname
·        Place the following line in the /usr/local/bin/sethostname
       echo desired_hostname > /proc/sys/kernel/hostname
·        chmod 755 /usr/local/bin/sethostname
·        Issue crontab –e and place the following line in the cron tab and save.
   # SET HOSTNAME
   * * * * * /usr/local/bin/sethostname >> /usr/local/bin/sethostname.log 2>&1
·        The desired_hostname and IP entry needs to be in the /etc/hosts file

desired_hostname = Hostname of your choice.

No comments:

Post a Comment