pf::services::manager
pf::services::manager
This module encapsulates the service actions/commands for pfcmd tool
An example of a new service foo
package pf::services::manager::moo; use strict; use warnings; use Moo; extends 'pf::services::manager'; has '+name' => ( default => sub { 'foo' } ); has '+launcher' => (default => sub { '%1$s -d' } );
To include the new service in pfcmd service
* Add service name to the service regex in pf::pfcmd
* Update the help in pf::pfcmd::help
name of service
if service requires checkup
sprintf-formatted string that control how the services should be started %1$s: is the service executable %2$s: optional parameters
services that this service needs in order to start
executable of service
The last pid retrived from the pidFile
The inotify object used to watch for pidfile
If the service is a virtual service
If set then the service is forced to be considered managed
builds the inotify object
start the service
work for starting a servicw
Starts the service
Cleanup work after the starting the service
This setups a watch on the run directory to wait for the pid to
the builder the executable attribute
restart the service
returns the pid or list of pids for the servie(s)
Returns the pid of the service
Stop the service waitinf for it to shutdown
the pre stop setup
If the service is stopped start the service
generates the configuration files for the service
launch the service using the launcher and arguements passed
TODO: documention
TODO: documention
return the pid file of the service
get the pid from the pid file
removes the stale PID file
checks if process is alive
return true is the service is currently managed by packetfence
Inverse inc. <info@inverse.ca>
Copyright (C) 2005-2015 Inverse inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.