236. Service

Service manipulation

236.1. Authors

  • Martin Vidner <mvidner@suse.cz>

  • Petr Blahos <pblahos@suse.cz>

  • Michal Svec <msvec@suse.cz>

  • Lukas Ocilka <locilka@suse.cz>

236.2. Summary of Module Globals

List of Global Functions

  • Adjust - Adjust runlevels in which the service runs.

  • Disable - Disable service

  • Enable - Enable service

  • Enabled - Check if service is enabled

  • EnabledServices - Get list of enabled services in a runlevel

  • Error - Error Message

  • Find - Return the first of the list of services which is available (has init script) or "" if none is.

  • Finetune - Set service to run in selected runlevels.

  • FullInfo - Get service info and find out whether service is running.

  • Info - Get service info without peeking if service runs.

  • Reload - Reload service

  • Restart - Restart service

  • RunInitScript - Run init script.

  • RunInitScriptWithTimeOut - Run init script with a time-out.

  • Start - Start service

  • Status - Get service status.

  • Stop - Stop service

List of Global Variables

    236.3. Global Functions

    236.3.1. Adjust

    Adjust runlevels in which the service runs.

    Function parameters

    • string name

    • string action

    Return value

    • boolean - success state

    236.3.2. Disable

    Disable service

    Function parameters

    • string service

    Return value

    • boolean - true if operation is successful

    236.3.3. Enable

    Enable service

    Function parameters

    • string service

    Return value

    • boolean - true if operation is successful

    236.3.4. Enabled

    Check if service is enabled

    Function parameters

    • string name

    Return value

    • boolean - true if service is set to run in any runlevel

    236.3.5. EnabledServices

    Get list of enabled services in a runlevel

    Function parameters

    • integer runlevel

    Return value

    • list<string> - enabled services

    236.3.6. Error

    Error Message

    Return value

    • string - error message from the last operation

    236.3.7. Find

    Return the first of the list of services which is available (has init script) or "" if none is.

    Function parameters

    • list <string> services

    Return value

    • string - the first found service

    236.3.8. Finetune

    Set service to run in selected runlevels.

    Function parameters

    • string name

    • list rl

    Return value

    • boolean - success state

    236.3.9. FullInfo

    Get service info and find out whether service is running.

    Function parameters

    • string name

    Return value

    • map - service map or empty map ($[])

    236.3.10. Info

    Get service info without peeking if service runs.

    Function parameters

    • string name

    Return value

    • map - Service information or empty map ($[])

    236.3.11. Reload

    Reload service

    Function parameters

    • string service

    Return value

    • boolean - true if operation is successful

    236.3.12. Restart

    Restart service

    Function parameters

    • string service

    Return value

    • boolean - true if operation is successful

    236.3.13. RunInitScript

    Run init script.

    Function parameters

    • string name

    • string param

    Return value

    • integer - exit value

    236.3.14. RunInitScriptWithTimeOut

    Run init script with a time-out.

    Function parameters

    • string name

    • string param

    Return value

    • integer - exit value

    236.3.15. Start

    Start service

    Function parameters

    • string service

    Return value

    • boolean - true if operation is successful

    236.3.16. Status

    Get service status.

    Function parameters

    • string name

    Return value

    • integer - init script exit status or -1 if it does not exist

    236.3.17. Stop

    Stop service

    Function parameters

    • string service

    Return value

    • boolean - true if operation is successful

    236.4. Global Variables

    236.5. Module Requirements

    none