When a service exits and triggers either an OnFailure= or OnSuccess= dependency we now set a new environment variable for the ExecStart= and ExecStartPre= process. This variable $MONITOR_METADATA exposes the metadata relating to the service which triggered the dependency. MONITOR_METADATA takes the following form: MONITOR_METADATA="SERVICE_RESULT=<result-string0>,EXIT_CODE=<exit-code0>,EXIT_STATUS=<exit-status0>,INVOCATION_ID=<id>,UNIT=<triggering-unit0.service>;SERVICE_RESULT=<result-stringN>,EXIT_CODE=<exit-codeN>,=EXIT_STATUS=<exit-statusN>,INVOCATION_ID=<id>,UNIT=<triggering-unitN.service>" MONITOR_METADATA is space separated set of metadata relating to the service(s) which triggered the dependency. This is a list since if we have 2 services which trigger the same dependency then the dependency start job may be merged. In this case we need to pass both service metadata to the triggered service. If there is no job merging then MONITOR_METADATA will be a single entry. For example, in the case we had a service "failer.service" which triggers "failer-handler.service", the following variable is exported to the ExecStart= and ExecStartPre= processes in failer-handler.service: MONITOR_METADATA="SERVICE_RESULT=exit-code,EXIT_CODE=exited,EXIT_STATUS=1,INVOCATION_ID=67c657ed7b34466ea369abdf994c6393,UNIT=failer.service" In another example where we have failer.service and failer2.service which both also trigger failer-handler.service then the start job for failer-handler.service may be merged and we might get the following: MONITOR_METADATA="SERVICE_RESULT=exit-code,EXIT_CODE=exited,EXIT_STATUS=1,INVOCATION_ID=16a93ad196c94109990fb8b9aa5eef5f,UNIT=failer.service;SERVICE_RESULT=exit-code,EXIT_CODE=exited,EXIT_STATUS=1,INVOCATION_ID=ff70131e4cc145e994fb621de25a3e8f,UNIT=failer2.service"
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.
