ManaTools::Shared::Services

Section: User Contributed Perl Documentation (3)
Updated: 2017-07-06
Page Index
 

NAME

ManaTools::Shared::Services - shares the API to manage services  

SYNOPSIS

use ManaTools::Shared::Services;

my $serv = ManaTools::Shared::Services->new();

my ($l, $on_services) = $serv->services();  

DESCRIPTION

  This module aims to share all the API to manage system services,
  to be used from GUI applications or console.

  From the original code drakx services.

 

SUPPORT

You can find documentation for this module with the perldoc command:

perldoc ManaTools::Shared::Services  

SEE ALSO

ManaTools::Shared  

AUTHOR

Angelo Naselli <anaselli@linux.it>  

COPYRIGHT and LICENSE

Copyright (C) 2013-2016, Angelo Naselli.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation.

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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  

FUNCTIONS

 

attributes

service_info

    A HashRef collecting all the service information.
    if include_static_services (default is false) is set also static
    services are included.

 

description

INPUT

name: Service Name

OUTPUT

Description: Service description

DESCRIPTION

THis function return the description for the given service  

set_service

INPUT

    $service: Service name
    $enable:  enable/disable service

DESCRIPTION

    This function enable/disable at boot the given service

 

xinetd_services

OUTPUT

    xinetd_services: All the xinetd services

DESCRIPTION

    This functions returns all the xinetd services in the system.
    NOTE that xinetd *must* be enable at boot to get this info

 

services

INPUT

    $reload: load service again

OUTPUT

    @l:           all the system services
    @on_services: all the services that start at boot

DESCRIPTION

    This function returns two lists, all the system service and
    all the active ones.

 

service_exists

INPUT

    $service: Service name

OUTPUT

    0/1: if the service exists

DESCRIPTION

    This function checks if a service is installed by looking for
    its unit or init.d service

 

restart

INPUT

    $service: Service to restart

DESCRIPTION

    This function restarts a given service

 

restart_or_start

INPUT

    $service: Service to restart or start

DESCRIPTION

    This function starts a given service if it is not running,
    it restarts that otherwise

 

startService

INPUT

    $service: Service to start

DESCRIPTION

    This function starts a given service

 

start_not_running_service

INPUT

    $service: Service to start

DESCRIPTION

    This function starts a given service if not running

 

stopService

INPUT

    $service: Service to stop

DESCRIPTION

    This function stops a given service

 

is_service_running

INPUT

    $service: Service to check

DESCRIPTION

    This function returns if the given service is running

 

starts_on_boot

INPUT

    $service: Service name

DESCRIPTION

    This function returns if the given service starts at boot

 

start_service_on_boot

INPUT

    $service: Service name

DESCRIPTION

    This function set the given service active at boot

 

do_not_start_service_on_boot

INPUT

    $service: Service name

DESCRIPTION

    This function set the given service disabled at boot

 

enable

INPUT

    $service:         Service name
    $o_dont_apply:    do not start it now

DESCRIPTION

    This function set the given service active at boot
    and restarts it if o_dont_apply is not given

 

disable

INPUT

    $service:         Service name
    $o_dont_apply:    do not stop it now

DESCRIPTION

    This function set the given service disabled at boot
    and stops it if o_dont_apply is not given

 

set_status

INPUT

    $service:         Service name
    $enable:          Enable/disable
    $o_dont_apply:    do not start it now

DESCRIPTION

    This function set the given service to enable/disable at boot
    and restarts/stops it if o_dont_apply is not given

 

getUnitProperty

INPUT

    $unit: unit name
    $property: property name

OUTPUT

    $property_value: property value

DESCRIPTION

    This method returns the requested property value


 

Index

NAME
SYNOPSIS
DESCRIPTION
SUPPORT
SEE ALSO
AUTHOR
COPYRIGHT and LICENSE
FUNCTIONS
attributes
description
set_service
xinetd_services
services
service_exists
restart
restart_or_start
startService
start_not_running_service
stopService
is_service_running
starts_on_boot
start_service_on_boot
do_not_start_service_on_boot
enable
disable
set_status
getUnitProperty