1、安装
使用Apache_OpenOffice_4.1.5_Linux_x86-64_install-rpm_zh-CN.tar.gz安装包
使用命令
tar -xvzf
Apache_OpenOffice_4.1.5_Linux_x86-64_install-rpm_zh-CN.tar.gz
cd zh-CN/
RPMS/
rpm -ivh *.rpm
cd desktop-integration/
rpm -ivh openoffice4.1.5-redhat-menus-4.1.5-9789.noarch.rpm
2、启动
soffice -headless -accept="socket,host=127.0.0.1,port=9100;urp;" -nofirststartwizard &
启动后,使用命令netstat -lnp|grep 9100,如果查看到端口号,服务启动成功
3、在定时器中设置定时检测openoffice
在定时器中添加定时任务执行脚本crontab -e
*/5 * * * * /usr/local/crondopenoffice.sh
crondopenoffice.sh脚本的内容如下所示:
#!/bin/sh
if ps -ef|grep openoffice |egrep -v grep
then
/opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=9100;urp;" -nofirststartwizard &
else
echo "openoffice is start"
fi