\App\ServiceModule\ModelsSystemDManager

Tool for managing services (systemD init daemon)

Summary

Methods
Properties
Constants
__construct()
disable()
enable()
isActive()
isEnabled()
start()
stop()
restart()
getStatus()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$commandManager
$serviceName
N/A

Properties

$commandManager

$commandManager : \App\CoreModule\Models\CommandManager

Type

normal — Command Manager

$serviceName

$serviceName : string

Type

normal — Name of service

Methods

__construct()

__construct(\App\CoreModule\Models\CommandManager  $commandManager, string|null  $serviceName = null) : mixed

Constructor

Parameters

\App\CoreModule\Models\CommandManager $commandManager

Command manager

string|null $serviceName

Service name

Returns

mixed

disable()

disable(?string  $serviceName = null) : void

Disables the service

Parameters

?string $serviceName

Throws

\App\ServiceModule\Exceptions\NonexistentServiceException

enable()

enable(?string  $serviceName = null) : void

Enables the service

Parameters

?string $serviceName

Throws

\App\ServiceModule\Exceptions\NonexistentServiceException

isActive()

isActive(?string  $serviceName = null) : bool

Checks if the service is active

Parameters

?string $serviceName

Returns

bool —

Is service active?

isEnabled()

isEnabled(?string  $serviceName = null) : bool

Checks if the service is enabled

Parameters

?string $serviceName

Throws

\App\ServiceModule\Exceptions\NonexistentServiceException

Returns

bool —

Is service enabled?

start()

start(?string  $serviceName = null) : void

Starts the service

Parameters

?string $serviceName

Throws

\App\ServiceModule\Exceptions\NonexistentServiceException

stop()

stop(?string  $serviceName = null) : void

Stops the service

Parameters

?string $serviceName

Throws

\App\ServiceModule\Exceptions\NonexistentServiceException

restart()

restart(?string  $serviceName = null) : void

Restarts the service

Parameters

?string $serviceName

Throws

\App\ServiceModule\Exceptions\NonexistentServiceException

getStatus()

getStatus(?string  $serviceName = null) : string

Returns status of the service

Parameters

?string $serviceName

Throws

\App\ServiceModule\Exceptions\NonexistentServiceException

Returns

string —

Service status