• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

在HP-UX系统中添加在引导时运行的程序

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: Blog.ChinaUnix.net

软件测试论坛讨论

领测软件测试网

由于手工禁用了snmo、nfs等服务,导致rpcbind启动时未自动运行。为使rpcbind在引导时能自动运行,今天花了1个小时,搞掂了。

1、create /sbin/init.d/rpcbind
#!/sbin/sh
#
# @(#)B.11.11_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.
#

#
# Start rpcbind
#
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
rval=0
set_return() {
 x=$?
 if [ $x -ne 0 ]; then
  echo "ERROR CODE $x"
  rval=1
 fi
}
case in
start_msg)
 echo "Start rpcbind"
 ;;

stop_msg)
 echo "Stop rpcbind"
 ;;

'start')
 if [ -f /etc/rc.config.d/rpcbind ] ; then
  . /etc/rc.config.d/rpcbind
 else
  echo "ERROR: /etc/rc.config.d/rpcbind defaults file MISSING"
 fi
 
 if [ "$RPCBIND" -eq 1 -a -x /usr/sbin/rpcbind ]; then
  /usr/sbin/rpcbind && echo rpcbind started
  set_return
 else
  rval=2
 fi

 ;;

'stop')
 #
 # Determine PID of process(es) to stop
 #
 pid=`ps -el | awk '( ($NF ~ /rpcbind/) && ( != mypid) && ( != mypid)  ){ print }' mypid=$$ `
 if [ "X$pid" != "X" ]; then
  if kill $pid; then
   echo "rpcbind stopped"
  else
   set_return
   echo "Unable to stop rpcbind"
  fi
 fi
 ;;

*)
 echo "usage: "
 ;;
esac

exit $rval

2、chown bin:bin rpcbind

3、create /etc/rc.config.d/rpcbind
#!/sbin/sh
# @(#)B.11.11_LR       
# Cron configuration.  See cron(1m)
#
# RPCBIND:  Set to 1 to start cron daemon
#
RPCBIND=1
4、chown bin:bin rpcbind
5、create /sbin/rc3.d/S900rpcbind
内容同/sbin/init.d/rpcbind
6、chown bin:bin /sbin/rc3.d/S900rpcbind
7、create /sbin/rc2.d/K150rpcbind
内容同/sbin/init.d/rpcbind
8、chown bin:bin sbin/rc2.d/K150rpcbind
其余权限设置与同类文件相同。

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网