hostname megvaltoztatasa h-up rx2660 szerveren

Fórumok

Sziasztok,

van egy rendszerem:
#uname -a
HP-UX oldhostname B.11.23 U ia64 0777130343 unlimited-user license
#model
ia64 hp server rx2660
#

melynek uj hostname-et szeretnek adni.

Amit probaltam:

1.
#hostname "newname"
#uname -S "newname"
#update /etc/hosts and /etc/rc.config.d/netconf
reboot
2.
set_parms hostname
reboot

mindkettot kiprobalva reboot utan a regi hostname jon be.
Hogy lehetne rabirni a rendszert, hogy elfogadja az uj nevet?
A rendszeren egy oracle is fut - hatassal van e valtoztatas erre is?
Koszi a segiteseget,
ardi

Hozzászólások

Amennyit tudok a hpux rol, csakis mindent SAM-en keresztul konfolj. Legalábbis en ezt tapasztaltam a sajat hp-ux 11.11 es rendszeremen.

Fedora 22, Thinkpad x220

Ezt probaltad mar editalni?

/etc/rc.config.d/netconf

A set_parms -nak - meg a SAM-nak is - elégnek kell lennie (az konkrétan a /etc/rc.config.d-beli fájlban írja át). Picit részletesebben leírnád, hogy mit jelent ez: "reboot utan a regi hostname jon be."

Nézd meg, hogy a bootkori beállítások során nem problémázik-e valamivel. A /etc/rc.log-ban (meg esetleg az OLDlog) nem nyekereg-e valami bootkori hibát, lévén ha átírod a netconf-ot (akármivel), akkor azt a 11v2-ben a boot-kor be kell állítania; ha nem sikerül, azt meg jeleznie kell.

Nos, az /etc/rc.log.old fajlban csupan ez utal a hostname beallitasara.

a)
Setting hostname
Output from "/sbin/rc1.d/S320hostname start":

cat /sbin/rc1.d/S320hostname
#!/sbin/sh
#
# @(#)B11.23_LR
#
# NOTE: This script is not configurable! Any changes made to this
# scipt will be overwritten when you upgrade to the next
# release of HP-UX.
#
# WARNING: Changing this script in any way may lead to a system that
# is unbootable. Do not modify this script.
#

#
# Set hostname
#

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

rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1
fi
}

case $1 in
start_msg)
echo "Setting hostname"
;;

start)
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi

hostname $HOSTNAME
set_return

if [ -z "$NODENAME" ] ; then
uname -S ${HOSTNAME%%.*}
else
uname -S $NODENAME
fi
set_return

# JAGae29563 ( uname(1) is displaying -t as the OS name )
# Adding a condition to check OPERATING_SYSTEM, before sending it to
# setuname. previously setuname was called as "setuname -s
# $OPERATING_SYSTEM -t". If OPERATING_SYSTEM is not set, then -t
# is taken as argument to -s and OPERATING_SYSTEM is set to -t.
# The manpage of setuname clearly says, -s needs an argument.

if [ -z "$OPERATING_SYSTEM" ]; then
echo "WARNING: OPERATING_SYSTEM is not set."
echo " using default value of HP-UX"
OPERATING_SYSTEM=HP-UX
fi
setuname -t -s $OPERATING_SYSTEM
set_return
;;

*)
echo "usage: $0 {start}"
;;
esac

exit $rval
#

cat /etc/rc.config
# This script sources configuration files for various subsystems. Configuration
# variables are in files CFG_FILE in /etc/rc.config.d/*, and /etc/TIMEZONE.
# Simple error checks are done: test file perms and for dumped "core" files.
# Filenames containing [.,~#] are not sourced - they are possible names of
# backup files such as file.bak, file.OLD, ~file, file~, file,v, #file etc.
#
# @(#)B11.23_LR

for CFG_FILE in /etc/rc.config.d/* /etc/TIMEZONE
do
fname=${CFG_FILE##*/} # get file basename
if [ -f $CFG_FILE -a "$fname" != "core" -a "${fname##*[.,~\#]}" = "$fname" ]
then . $CFG_FILE # source a valid config file
fi
done

b)
es ez:

Output from "/sbin/rc2.d/S120swconfig start":
----------------------------
* Turning off all network based resolving services in
'/etc/nsswitch.conf'
* Setting up temporary hostname in '/etc/hosts'
* Restoring '/etc/hosts' to its original contents.
* Removing the temporary '/etc/nsswitch.conf'.

Ezt a /sbin/rc2.d/S120swconfig fajlt nem kopirozom ide - tul hosszu ...

ardi

-r--r--r-- 1 bin bin 5254 Aug 24 13:38 hpigelanconf
-r--r--r-- 1 bin bin 7618 Aug 24 13:39 netconf
dr-xr-xr-x 33 bin bin 7168 Aug 25 10:48 ..

cat hpigelanconf:
-------------------
(ami fontos)
HP_IGELAN_INIT_ARGS="HP_IGELAN_STATION_ADDRESS HP_IGELAN_SPEED HP_IGELAN_MTU HP_IGELAN_FLOW_CONTROL HP_IGELAN_AUTONEG HP_IGELAN_SEND_COAL_TICKS HP_IGELAN_RECV_COAL_TICKS HP_IGELAN_SEND_MAX_BUFS HP_IGELAN_RECV_MAX_BUFS HP_IGELAN_VMTU"

HP_IGELAN_INTERFACE_NAME[0]=lan0
HP_IGELAN_STATION_ADDRESS[0]=
HP_IGELAN_SPEED[0]=auto_on
HP_IGELAN_MTU[0]=1500
HP_IGELAN_FLOW_CONTROL[0]=1
HP_IGELAN_AUTONEG[0]=0
HP_IGELAN_SEND_COAL_TICKS[0]=150
HP_IGELAN_RECV_COAL_TICKS[0]=0
HP_IGELAN_SEND_MAX_BUFS[0]=10
HP_IGELAN_RECV_MAX_BUFS[0]=1
HP_IGELAN_VMTU[0]=0
HP_IGELAN_SEND_CKO[0]=
HP_IGELAN_RECV_CKO[0]=
HP_IGELAN_DIAG_THRESH[0]=

cat netconf:(ami fontos)
------------
HOSTNAME=a_regi_hostname
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
.
.
.
.# Management Lan
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=xx.xx.xx.xx
SUBNET_MASK[0]=255.255.255.192
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]="up"
DHCP_ENABLE[0]=0
.
.
.es meg sok egyeb

a kidobas azt jelenti, hogy kihagytam azokat a reszeket, ahol nem szerepel a regi hostname.

oldhostname:/etc/rc.config.d#grep oldhostname /etc/*
/etc/#hosts:#xx.xx.xx.xx oldhostname_mgt
/etc/#hosts:#rr.rr.rr.rr oldhostname_web
grep: can't open /etc/dce.clean
grep: can't open /etc/disksecn
grep: can't open /etc/dumpdates
grep: can't open /etc/eisa_config
/etc/hosts:tt.tt.tt.tt oldhostname oldhostname.ttt.lab
/etc/hosts:#xx.xx.xx.dd oldhostname_mgt
/etc/hosts:#xx.xx.xx.ff oldhostname_web
/etc/old.hosts:xx.xx.xx.dd oldhostname_mgt
/etc/old.hosts:xx.xx.xx.ff oldhostname_web
/etc/rc.log:sudo: unable to lookup oldhostname via gethostbyname()
/etc/rc.log:sudo: unable to lookup oldhostname via gethostbyname()
/etc/rc.log.old:sudo: unable to lookup oldhostname via gethostbyname()
/etc/rc.log.old:sudo: unable to lookup oldhostname via gethostbyname()
grep: can't open /etc/savecore
/etc/shutdownlog:14:22 Fri Nov 14, 2008. Halt: (by oldhostname!root)
/etc/shutdownlog:09:58 Wed Nov 19, 2008. Reboot: (by oldhostname!root)
/etc/shutdownlog:14:02 Wed Nov 19, 2008. Reboot: (by oldhostname!root)
/etc/shutdownlog:14:17 Wed Nov 19, 2008. Reboot: (by oldhostname!root)
/etc/shutdownlog:11:37 Fri Nov 21, 2008. Reboot: (by oldhostname!root)
/etc/shutdownlog:17:53 Thu Oct 22, 2009. Reboot: (by oldhostname!ocadmin)
/etc/shutdownlog:09:57 Tue Feb 16, 2010. Reboot: (by oldhostname!root)
/etc/shutdownlog:14:47 Fri Apr 23, 2010. Reboot: (by oldhostname!ocadmin)
/etc/shutdownlog:15:33 Fri Apr 23, 2010. Reboot: (by oldhostname!ocadmin)
/etc/shutdownlog:14:01 Fri Apr 23, 2010. Reboot: (by oldhostname!ocadmin)
/etc/shutdownlog:14:35 Fri Oct 7, 2011. Halt: (by oldhostname!ocadmin)
/etc/shutdownlog:03:45 Mon Oct 10, 2011. Halt: (by oldhostname!root)
/etc/shutdownlog:09:31 Wed Dec 7, 2011. Reboot: (by oldhostname!root)
/etc/shutdownlog:10:07 Wed Dec 7, 2011. Reboot: (by oldhostname!root)
/etc/shutdownlog:11:12 Wed Dec 7, 2011. Reboot: (by oldhostname!root)
/etc/shutdownlog:11:31 Mon Dec 12, 2011. Reboot: (by oldhostname!root)
/etc/shutdownlog:07:44 Tue Dec 13, 2011. Reboot: (by oldhostname!root)
/etc/shutdownlog:11:26 Thu Dec 15, 2011. Halt: (by oldhostname!root)
/etc/shutdownlog:05:06 Fri Dec 16, 2011. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:05:43 Fri Dec 16, 2011. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:12:58 Fri Feb 6, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:10:05 Mon Feb 9, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:11:22 Mon Feb 9, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:14:25 Fri Aug 21, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:08:38 Mon Aug 24, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:09:01 Mon Aug 24, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:09:26 Mon Aug 24, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:12:37 Mon Aug 24, 2015. Reboot: (by oldhostname!userxxx)
/etc/shutdownlog:13:43 Mon Aug 24, 2015. Reboot: (by oldhostname!userxxx)
grep: can't open /etc/vtdaemonlog
/etc/wtmp:0pts/0I?ñ>ocadmin0pts/0E×IA
}uu.uu.uu.uu9ÒÓóocadmin3pts/3EúIA
Ìqq.ww.ww.ww9ÒÓóocadmin4pts/4F
IA
Òrr.tt.yy.uu9ÒÓó3pts/3EIA0pts/0EIA;4pts/4F
IAIocadmin0pts/0+bIB\jtt.yy.uu.uu9ÒÓóocadmin3pts/3+IB]¤qq.ww.ee.rr9ÒÓóocadmin5pts/5.IBcnqq.ww.ee.rr9ÒÓó5pts/5IBÐ0pts/0+IB 3pts/3IB Qoldhostname_web¬ôò0pts/0IB `4pts/4IB¢Ç1pts/1_IC2pts/2
PuTTYoldhostname:/etc/rc.config.d#PuTTY