how puppet restart a service

1,286 views
Skip to first unread message

陈士超

unread,
Mar 15, 2013, 3:06:02 AM3/15/13
to puppet...@googlegroups.com
i do like this:
service{
"lighttpd":
hasrestart => true,
hasstatus => true,
restart => "/sbin/service lighttpd restart",
}

But it dose not work

Ellison Marks

unread,
Mar 15, 2013, 12:46:15 PM3/15/13
to puppet...@googlegroups.com
You don't need the restart command there. When you say "hasrestart => true", you're telling puppet that the init script has a restart command, so it's going to call "/sbin/service lighttpd restart" anyway. If you say "hasrestart => false", the default is to do a "service lighttpd stop && service lighttpd start". The restart parameter is for specifying the command to restart the service if it isn't handled by the init script and you want something more complicated than the default.

尹川51web

unread,
Mar 15, 2013, 5:56:47 AM3/15/13
to puppet...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
尹川
成都世纪东方网络通信有限公司
手机:18628014224
QQ:254113859

Dan White

unread,
Mar 15, 2013, 11:07:46 PM3/15/13
to puppet...@googlegroups.com
Try this:

service { "lighttpd":
ensure => running,
enable => true,
hasrestart => true,
hasstatus => true,
restart => "/sbin/service lighttpd restart",
}

The “enable” parameter enables the service to start at boot.
The “ensure” parameter ensures the service is running.
Reply all
Reply to author
Forward
0 new messages