栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

sh startup.sh使用人偶模块启动tomcat

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

sh startup.sh使用人偶模块启动tomcat

我建议您安装服务脚本,而不是声明执行文件以启动应用程序服务器。
这样,您可以依赖

service
资源类型的功能,该功能将帮助您检查服务的状态并确保它是预期的。
您可以在此处找到一个示例脚本,该脚本可以放在
templates/
模块目录中。
tomcat.erb


基本上,你会做什么,然后是声明

file
exec
service
资源三重如下(例如基于红帽的操作系统,类似的适用于Debian /
Ubuntu的除了
chkconfig
部分):

file { '/etc/init.d/tomcat':  ensure => present,  content => template('tomcat/tomcat.erb'),  mode   => 'u=rwx,og=rw',  user   => 'root',  group  => 'root',  notify  => Exec['add_tomcat_service'],}exec {'add_tomcat_service':  command   => '/sbin/chkconfig --add tomcat',  path      => ['/bin', '/sbin', '/usr/bin', '/usr/sbin'],  onlyif    =>  "test `/sbin/chkconfig --list | /bin/grep tomcat | /usr/bin/wc -l` -eq 0",  before    => Service['tomcat'],}service { 'tomcat':  ensure  => started,  hasstatus => true,  hasrestart => true,}


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/386538.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号