openmediavault  4.0 (Arrakis)
The open network attached storage solution
Public Member Functions | List of all members
OMV\System\SysVInitScript Class Reference

Public Member Functions

 __construct ($name, $enable=FALSE, $update=TRUE)
 
 exec ()
 
 enable ()
 
 disable ()
 
 defaults ()
 
 remove ()
 
 start ()
 
 stop ()
 
 restart ()
 
 reload ()
 
 invoke ($action)
 
 status ()
 

Constructor & Destructor Documentation

◆ __construct()

OMV\System\SysVInitScript::__construct (   $name,
  $enable = FALSE,
  $update = TRUE 
)

Constructor

Parameters
nameThe name of the init script.
enableTRUE to start the process. Defaults to FALSE.
updateTRUE to call the update-rc.d script. Defaults to TRUE.

Member Function Documentation

◆ defaults()

OMV\System\SysVInitScript::defaults ( )

Make links to start and stop the service in the defined runlevels.

◆ disable()

OMV\System\SysVInitScript::disable ( )

Disable the system init script.

◆ enable()

OMV\System\SysVInitScript::enable ( )

Enable the system init script.

◆ exec()

OMV\System\SysVInitScript::exec ( )

Depending on the given constriuctor parameter do the following:

  1. Stop the init script
  2. If service is enabled, then install and start init script, otherwise remove init script.

◆ invoke()

OMV\System\SysVInitScript::invoke (   $action)

Invoke init script with the given aktion. Throws an exception in case of an error.

Parameters
actionThe action to be executed.
Exceptions
E_EXEC_FAILED

◆ reload()

OMV\System\SysVInitScript::reload ( )

Invoke init script with parameter 'reload'.

◆ remove()

OMV\System\SysVInitScript::remove ( )

Remove the system init script from all runlevels.

◆ restart()

OMV\System\SysVInitScript::restart ( )

Invoke init script with parameter 'restart'.

◆ start()

OMV\System\SysVInitScript::start ( )

Invoke init script with parameter 'start'.

◆ status()

OMV\System\SysVInitScript::status ( )

Invoke init script with parameter 'status'.

Returns
One of the following exit status codes: 0 program is running or service is OK 1 program is dead and /var/run pid file exists 2 program is dead and /var/lock lock file exists 3 program is not running 4 program or service status is unknown 5-99 reserved for future LSB use 100-149 reserved for distribution use 150-199 reserved for application use 200-254 reserved See http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

◆ stop()

OMV\System\SysVInitScript::stop ( )

Invoke init script with parameter 'stop'.


The documentation for this class was generated from the following file: