Service Resources
The service resource can not only start, restart and close the daemon of the program, monitor the status of the process, but also can add the daemon to the self-boot.
1. Common Properties of service resources
Service {' Resource title ':
Binary
Enable
Ensure
Hasrestart
Hasstatus
Name
Path
Pattern
Restart
Start
Status
Stop
Provider
}
Enable: Specifies whether the service starts at boot time and can be set to true and false.
ensure: Whether the service is running, running is running, and stopped represents stopping the service.
Name: daemon names.
Path: Starts the script search path.
Hasrestart: Indicates whether the management script supports the restart parameter, and if not, use stop and start to implement the restart effect.
Hasstatus: Indicates whether the management script supports the status parameter, puppet uses the status parameter to determine if the service is already running, and if the status parameter is not supported, Puppet uses the lookup run process list to determine if a service is running.
provider: default is init.
Case
Start the httpd daemon
Service {' httpd ':
ensure = running,
}
Set httpd boot from
Service {' httpd ':
ensure = True,
}
please pay attention to http://www.wzlinux.com:45 and http://www.wzlinux.com .
This article is from the "Small Drops Linux" blog, make sure to keep this source http://wangzan18.blog.51cto.com/8021085/1685650
Puppet Advanced Guide--service Resources detailed