HPUX系统启动后主机名为unknown的解决办法

时间:2021-10-29 13:46:14
HPUX系统启动完成后,主机名为unknown,查看/etc/rc.log出现如下报错:
 
unknown:[/]grep -i error /etc/rc.log
/sbin/rc1.d/S320hostname[36]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S020evm[67]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S130pfilboot[5]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S131ipfboot[5]: Syntax error at line 2 : `)' is not expected.
ERROR: /opt/sec_mgmt/bastille/swLoopbackConfig.sh not present. Exiting.
evmpost: Error: Connection error
/sbin/rc2.d/S356dhcpv6.server[32]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S360dhcpv6.client[40]: Syntax error at line 2 : `)' is not expected.
ERROR:   Internal error.  Security check failed unexpectedly.  This
         error occurred in function "idam_LocateLocalFile", source file
ERROR:   "unknown:/":  You do not have permission for this operation.
ERROR:   Internal error.  Security check failed unexpectedly.  This
         error occurred in function "idam_LocateLocalFile", source file
ERROR:   "unknown:/":  You do not have permission for this operation.
/sbin/rc2.d/S490mrouted[39]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S500inetd[38]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S510gated[38]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S523pppoe[39]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S530rwhod[39]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S538rtradvd[48]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S540sendmail[115]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S550ddfa[40]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S560SnmpMaster[167]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S565OspfMib[74]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S565SnmpHpunix[203]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S565SnmpIpv6[197]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S565SnmpMib2[207]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S565SnmpNaa[191]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S565SnmpTrpDst[208]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S590Rpcd[30]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S660xntpd[37]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S700acct[39]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S738oserrlog[19]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S742diagnostic[28]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S800spa[39]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S900drd[21]: Syntax error at line 2 : `)' is not expected.
/sbin/rc2.d/S980TftpdStandAlone[78]: Syntax error at line 2 : `)' is not expected.
/sbin/rc3.d/S823hpws22_apache[44]: Syntax error at line 2 : `)' is not expected.
/sbin/rc3.d/S823hpws22_tomcat[46]: Syntax error at line 2 : `)' is not expected.
ERROR: Could not start Tomcat.
/sbin/rc3.d/S823hpws22_webmin[45]: Syntax error at line 2 : `)' is not expected.
ERROR: Could not start Webmin
/sbin/rc3.d/S823hpws22_webproxy[44]: Syntax error at line 2 : `)' is not expected.
/sbin/rc3.d/S823hpws_xmltools[42]: Syntax error at line 2 : `)' is not expected.
/sbin/rc3.d/S828kwdbd[164]: Syntax error at line 2 : `)' is not expected.
 
问题原因:
/etc/rc.config.d/目录先出现了不能识别的启动控制文件或启动控制文件中有错误的符号或参数。
 
解决方案:
使用sh -x /etc/rc.config确认是哪一个配置文件有错误,然后把错误文件修复或移除错误文件即可;如果是配置文件参数错误,需要逐个文件去排查。