6. Layer root

6.1. Overview

This is the root layer of the MFSYSCOM module.

This layer mainly includes core libraries and utilities like :

  • layerapi2 library and utilities which manage the layer system

  • wrappers (python2, python3, python…)

  • (and some other documented below)

The root layer is loaded by default and does not depend on another layer. This is the layer dependencies root.

7. Special focus on python wrappers

7.1. python2 wrapper

The python2 wrapper is available in ${MFEXT_HOME}/bin. It executes a python2 interpreter with following layers loaded :

  • python2_core@mfext

  • python2@mfext (if installed)

  • python2_misc@mfext (if installed)

  • python2@{current_module} (if installed)

So, if you want to execute a python2 script without any question about currently loaded layers, this is the way to go.

For example:

#!/usr/bin/env python2

print "this code will be always executed in python2 environment"
print "(thanks to the above python2 shebang)"

or

python2 /path/to/a/python2/script.py

7.2. python3 wrapper

The python3 wrapper is available in ${MFEXT_HOME}/bin. It executes a python3 interpreter with following layers loaded :

  • python3_core@mfext

  • python3@mfext (if installed)

  • python3_misc@mfext (if installed)

  • python3@{current_module} (if installed)

So, if you want to execute a python3 script without any question about currently loaded layers, this is the way to go.

For example:

#!/usr/bin/env python3

print("this code will be always executed in python3 environment")
print("(thanks to the above python3 shebang)")

or

python3 /path/to/a/python3/script.py

7.3. python wrapper

The python wrapper is available in ${MFEXT_HOME}/bin. It works exactly as the two above wrappers. But the major python version is selected with the METWORK_PYTHON_MODE environment variable.

7.4. Metadata

7.4.1. Layer Home

/opt/metwork-mfsysmon-0.9

7.4.2. Label

root@mfsysmon

7.4.3. Package

metwork-mfsysmon-minimal

7.4.4. Dependencies

  • misc@mfext

  • python3_misc@mfext

  • monitoring@mfext

  • #+python3_circus@mfext

7.5. Utilities

7.5.1. mfsysmon.stop

Stop the mfsysmon module. This is nearly the same thing than service metwork stop mfsysmon (as root user).

7.5.2. mfsysmon.status

Get the status of the mfsysmon module. This is nearly the same thing than service metwork status mfsysmon (as root user).

The (unix) return code will be 0 if the module is ok.

7.5.3. mfsysmon_wrapper

/bin/sh: mfsysmon_wrapper: command not found