Cheatsheet
1. root service commands
As root unix user:
| Command | Description | 
|---|---|
| service metwork start | start all installed metwork services | 
| service metwork stop | stop all installed metwork services | 
| service metwork status | check all installed metwork services | 
| service metwork start mfdata | start mfdata metwork services | 
| service metwork stop mfdata | stop mfdata metwork services | 
| service metwork status mfdata | check mfdata metwork services | 
Note: if you don't have
servicecommand on your Linux distribution, you can use/etc/rc.d/init.d/metworkinstead ofservice metwork. For example:/etc/rc.d/init.d/metwork startinstead ofservice metwork start. If your Linux distribution usessystemdcomponent, you can also start metwork services with classicsystemctlcommands.
2. root files or directories
| Path | Description | 
|---|---|
| /etc/metwork.config.d/mfdata/config.ini | override the mfdatamodule configuration at system level (note: the first line of this file must be[INCLUDE_config.ini]) | 
| /opt/metwork-mfdata/config/config.ini | default mfdatamodule configuration (useful to see all configuration options) (do not edit this file => use the overriding previous file) | 
| /etc/metwork.config.d/mfdata/plugins/ | put some .pluginfiles here and they will be installed duringmfdataservice startup, put some.inifile fragments here as{plugin_name}.iniand they will be used as configuration override for the specified plugin | 
3. "load environment" commands
As a "not metwork" unix user (useless if you are logged as a "mfxxx" unix user as the "metwork environment" is already loaded):
| Command | Description | 
|---|---|
| source /opt/metwork-mfdata/share/interactive_profile | load the mfdata metwork interactive environment | 
| source /opt/metwork-mfdata/share/profile | load the mfdata metwork environment (same as above but without fancy stuff about banner, colors and prompt) | 
| /opt/metwork-mfdata/bin/mfdata_wrapper {YOUR_COMMAND} | execute the given command in the mfdata metwork environment without changing anything to the current environment | 
Note: if you don't have
/opt/metwork-mfdatasymbolic link, use/opt/metwork-mfdata-{BRANCH}instead.
4. module commands
As mfdata user:
| Command | Description | 
|---|---|
| mfdata.start | start mfdata services | 
| mfdata.stop | stop mfdata services | 
| mfdata.status | check mfdata services | 
| layers | list installed layers (loaded layers are prefixed by (*)),layers --helpfor more details | 
| layer_load {LAYER_NAME} | load the given layer (which must be installed), example: layer_load python3_devtools@mfext | 
| layer_unload {LAYER_NAME} | unload the given layer (which must be loaded), example: layer_unload python3@mfext | 
| components | list installed software components (loaded components are prefixed by (*)),components --helpfor more details | 
| metwork_debug | debug the current environment (layers, paths, versions...), useful for debugging or bug reporting | 
| outside {YOUR_COMMAND} | execute the given command outside the metwork environment without changing anything to the current environment | 
5. plugins management commands
As mfdata unix user:
| Command | Description | 
|---|---|
| plugins.list | list installed plugins | 
| plugins.install {/full/path/file.plugin} | install the given plugin file | 
| plugins.uninstall {plugin_name} | uninstall the given plugin name (the "plugin name" is given in the first column of the plugins.listoutput) | 
| plugins.info {plugin_name} | get some informations about the given plugin name (must be installed) | 
| plugins.info {/full/path/file.plugin} | get some informations about the given plugin file (does not need to be installed) | 
| plugin_env {plugin_name} | enter (interactively) in the given plugin environment | 
| plugin_wrapper {plugin_name} {YOUR_COMMAND} | execute the given command in the given plugin environment (without changing anything to your current environment), useful for cron jobs | 
6. plugins development commands and files
6.1 bootstrapping and building
As mfdata unix user, inside a plugin directory for make commands (you must have a Makefile and config.ini files inside the current working directory):
| Command | Description | 
|---|---|
| bootstrap_plugin.py list | list available plugin templates | 
| bootstrap_plugin.py create --template={TEMPLATE} {PLUGIN_NAME} | bootstrap a plugin directory {PLUGIN_NAME}from the given template | 
| make develop | install the current plugin in "development mode" (devlink) | 
| make release | release the current plugin as a .pluginfile | 
| make | refresh the virtualenvornode_modulesfrom requirements file | 
| make clean | "clean" the current plugin and keep only "non generated" files and directories (you should commit the remaining ones to your favorite version control system) ; after that, use maketo regenerate thevirtualenvornode_modules | 
| make superclean | same as cleantarget but also droprequirements2.txt,requirements3.txtand/orpackage-lock.jsonwhich can lead to a dependencies update (they are not frozen anymore) during nextmakecall | 
6.2 interesting files inside the plugin directory
| Relative path | Description | 
|---|---|
| config.ini | main plugin configuration file | 
| Makefile | build configuration file (you probably don't need to touch this unless you have specific build directives to add to the custom::target) | 
| local/ | local subdirectory (it mainly holds the python virtualenv), never touch this it's automatically generated) | 
| bin/ | if you put an executable in this directory, it will be available in PATH(in your plugin environment) | 
| lib/ | this library directory will be available in LD_LIBRARY_PATHand inPYTHONPATH(in your plugin environment), so you can put here shared libraries or python files you want to include easily | 
| postinstall | if this executable file is present during plugin installation, it will be automatically executed in the plugin environment just after the installation | 
| python3_virtualenv_sources/requirements-to-freeze.txt | main requirements file for python3 plugins (you shouldn't freeze versions here). | 
| python3_virtualenv_sources/requirements3.txt | frozen requirements file for python3 plugins (generated from requirements-to-freeze.txtfile, deleted bymake superclean, commit this file to your VCS to freeze your dependencies). | 
| python3_virtualenv_sources/allow_binary_packages | file to delete if you don't want pipto use binary packages (it will try to compile them during install) | 
| python3_virtualenv_sources/override | file to delete if you don't want pipto override packages available in mfext (it will try to use the version of mfext packages) | 
| .layerapi2_label | layerapi2 file to hold the plugin name as plugin_{plugin name}@module_in_lowercase | 
| .layerapi2_dependencies | layerapi2 file to hold the layers to load when entering the plugin environment (you can also put some plugins with the syntax plugin_{other plugin name}@module_in_lowercaseto inherit from another plugin | 
| .layerapi2_extra_env | can be used to define extra environment variables in your plugin environment (see layerapi2 documentation) | 
| .autorestart_includes | file patterns ( gitignoresyntax) scanned for changes to trigger a plugin autorestart | 
| .autorestart_excludes | file patterns ( gitignoresyntax) to exclude for scanning (see above) | 
| .plugin_format_version | version of the framework used to bootstrap the plugin (don't change this, this is used for backward compatibility) | 
| .releaseignore | file patterns ( gitignoresyntax) to ignore in the release.pluginfile | 
Note: mandatory files are in bold, all these files are not created by default (it mainly depends on the template you used) but you can create them afterwards.
Note: mandatory files are in bold, all these files are not created by default (it mainly depends on the template you used) but you can create them afterwards.