在vMA5.1上安装PCNS3.0.1时报错(我采用的是静态安装,即事先把参数设置好,然后执行安装文件并附带参数文件):
vi-admin@localhost:~/ESX> sudo ./install.sh -f silentInstall.sample
//安装命令,silentInstall.sample是参数文件。PCNS安装包解压后就有这个模板文件,我模板的基础上中只配置了UPS的IP,用户密码等基本参数。以下是执行安装时的结果
------------------------------------------------------------------
PowerChute Network Shutdown 3.0.1 for VMware
Copyright (c) 1999-2012 Schneider Electric.
All Rights Reserved.
------------------------------------------------------------------
OS=VIMA
Initializing ...
Silent mode input from silentInstall.sample
INSTALL_DIR=/opt/APC
JAVA_DIR=/usr/java/latest/bin/
EULA has been accepted
PCNS will be installed to /opt/APC/PowerChute
Checking version of Java ...
Detected Java Version: 1.6.0.41
Acceptable version
java version "1.6.0_41"
Java(TM) SE Runtime Environment (build 1.6.0_41-b02)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
JAVA_DIR=/usr/java/latest/bin/
Copying the installation files ...
Extracting PCNS files ...
PCNS is extracted to /opt/APC/PowerChute
Configuring startup files ...
Startup script=/etc/rc.d/init.d/PowerChute
cp: cannot create regular file `/etc/rc.d/init.d/PowerChute': No such file or directory
chmod: cannot access `/etc/rc.d/init.d/PowerChute': No such file or directory
Updating Linux symbolic link ...
PowerChute: unknown service
PowerChute: unknown service
Configuring uninstall script ...
Setup the m11.cfg file
Applying Configuration ...
Registration results ...
Connection to UPS Network Management Card (192.168.1.100) was successful.
Configuration complete.
./install.sh: line 1487: /etc/rc.d/init.d/PowerChute: No such file or directory
Installation has completed.
PowerChute Network Shutdown can be accessed through your browser at https://<your_server_ip_address>:6547
Please complete the configuration wizard so that PowerChute Network Shutdown can protect your server.
vi-admin@localhost:~/ESX>
---------------------------------------------------------
可看到,是在Install.sh中设置了启动PCNS的脚本未能被正确执行,经过查找验证发现,设置的路径不正确,
在vMA中的路径是/etc/init.d/,而不是/etc/rc.d/init.d/。
用sudo vi install.sh打开文件,搜索/etc/rc.d/init.d/可发现几个地方有配置(以下只写一个)
Initialize() {
Echo "Initializing ..."
case "$OS" in
$VIMA)
STARTUP=/etc/rc.d/init.d/PowerChute
PCBE_STARTUP=/etc/rc.d/init.d/PBEAgent
PCS_STARTUP=/etc/rc.d/init.d/pcs
;;
$XENSERVER)
STARTUP=/etc/rc.d/init.d/PowerChute
PCBE_STARTUP=/etc/rc.d/init.d/PBEAgent
PCS_STARTUP=/etc/rc.d/init.d/pcs
;;
$LINUX)
if [ -f /etc/SuSE-release ]; then
STARTUP=/etc/init.d/PowerChute
else
STARTUP=/etc/rc.d/init.d/PowerChute
fi
PCBE_STARTUP=/etc/rc.d/init.d/PBEAgent
PCS_STARTUP=/etc/rc.d/init.d/pcs
;;
$SOLARIS)
STARTUP=/etc/rc2.d/S99PowerChute
PCBE_STARTUP=/etc/rc2.d/S99PBEAgent
TR=/usr/xpg4/bin/tr
;;
$HPUX)
STARTUP=/sbin/init.d/pcns
;;
$AIX)
STARTUP=/etc/rc.APCpcns
;;
esac
}
我为了节省时间,把文档中的所有/etc/rc.d/init.d -> /etc/init.d/ 全部都替换了。然后在执行安装命令就可正常安装完成了。
由于vMA是Linux系统,从理论上说应该只要把OS为LINUX的地方改成/etc/rc.d/init.d/ -〉/etcinit.d/ 即可。
但没有时间验证,如果有人验证过,还请告知。