From 61e85f04b58ad3e07fe90961938e824b20f14091 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Fri, 22 Nov 2019 14:28:07 +0100 Subject: [PATCH] doc: explain the systemd commands of marsadm --- docu/mars-user-manual.lyx | 806 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 806 insertions(+) diff --git a/docu/mars-user-manual.lyx b/docu/mars-user-manual.lyx index 7cb90332..7dba771d 100644 --- a/docu/mars-user-manual.lyx +++ b/docu/mars-user-manual.lyx @@ -22985,6 +22985,812 @@ Postcondition: \end_inset +\end_layout + +\begin_layout Subsection + +\family typewriter +systemd +\family default + Control Commands +\begin_inset CommandInset label +LatexCommand label +name "subsec:systemd-Control-Commands" + +\end_inset + + +\end_layout + +\begin_layout Standard +These are optional commands when you want to use systemd for control of + your services running on top of MARS, and for more automated handover / + failover. + The concept is described in section +\begin_inset CommandInset ref +LatexCommand nameref +reference "sec:systemd-Templates" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +. +\end_layout + +\begin_layout Standard + +\size scriptsize +\begin_inset Tabular + + + + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +Command / Params +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +Cmp +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +Description +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "20col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +systemd-trigger +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +no +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "60col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\size scriptsize +Tell the macro processor engine of marsadm that some systemd templates and/or + configurations have changed. + This will automatically re-compute any necessary systemd units residing + in +\family typewriter +/run/systemd/system/ +\family default + from template files provided in one of the directories from +\family typewriter +@MARS_PATH/$SYSTEMD_SUBDIR/ +\family default +, and will automatically remove any +\emph on +instances +\emph default + (not templates) which are no longer needed. + Finally, +\family typewriter +systemctl reload-daemon +\family default + is executed, and any necessary units are started / stopped according to + the new situation. +\begin_inset Newline newline +\end_inset + +The macro language behind the template engine is described in section +\begin_inset CommandInset ref +LatexCommand nameref +reference "sec:systemd-Templates" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +. +\size default + +\begin_inset Newline newline +\end_inset + + +\begin_inset Graphics + filename images/lightbulb_brightlit_benj_.png + lyxscale 12 + scale 7 + +\end_inset + + +\size scriptsize + When combined with +\family typewriter +--force +\family default +, this will forcefully re-compute any template instances, even when already + created before. + Without +\family typewriter +--force +\family default +, there is an internal check whether re-creation is necessary. + This check might be fooled by manual intervention into +\family typewriter +/run/systemd/system/ +\family default +, so +\family typewriter +--force +\family default + will repair it. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "20col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +set-systemd-unit +\begin_inset Newline newline +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +strut +\backslash +hfill +\end_layout + +\end_inset + +$res +\begin_inset Newline newline +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +strut +\backslash +hfill +\end_layout + +\end_inset + +$start_unit +\begin_inset Newline newline +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +strut +\backslash +hfill +\end_layout + +\end_inset + +$stop_unit +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +no +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "60col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\size scriptsize +Assign new start and unit names to a resource, or delete any existing names + when the empty string +\family typewriter + +\begin_inset Quotes eld +\end_inset + + +\begin_inset Quotes erd +\end_inset + + +\family default + is provided as +\family typewriter +$start_unit +\family default +. + Afterwards, a +\family typewriter +systemd-trigger +\family default + is executed, which causes start / stop operations according to the new + situation. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "20col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +get-systemd-unit +\begin_inset Newline newline +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +strut +\backslash +hfill +\end_layout + +\end_inset + +$res +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "60col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\size scriptsize +Report the current assignment of start and stop unit names to the given + resource. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "20col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +set-systemd-want +\begin_inset Newline newline +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +strut +\backslash +hfill +\end_layout + +\end_inset + +$res +\begin_inset Newline newline +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +strut +\backslash +hfill +\end_layout + +\end_inset + +$hostname +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "60col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\size scriptsize +Manually override the host where $start_unit should appear. + This is useful for a temporary stop of the applicatiom stack when $hostname + has the special value +\family typewriter + +\begin_inset Quotes eld +\end_inset + +(none) +\begin_inset Quotes erd +\end_inset + + +\family default +. + See the +\family typewriter +fsck +\family default +example in section +\begin_inset CommandInset ref +LatexCommand nameref +reference "sec:systemd-Templates" +plural "false" +caps "false" +noprefix "false" + +\end_inset + +. +\begin_inset Newline newline +\end_inset + +In split brain situations, it +\emph on +might +\emph default + be useful for manual override, but notice that +\family typewriter +marsadm primary –force +\family default + should be preferred because it switches +\emph on +both +\emph default + the designated primary +\emph on +and +\emph default + the application stack. + Notice that the application stack won't actually start at a location where + +\family typewriter +/dev/mars/$res +\family default + is not present. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "20col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\family typewriter +\size scriptsize +get-systemd-want +\begin_inset Newline newline +\end_inset + + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +strut +\backslash +hfill +\end_layout + +\end_inset + +$res +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +no +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout + +\size scriptsize +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "60col%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "black" +backgroundcolor "none" +status open + +\begin_layout Plain Layout + +\size scriptsize +Report the current systemd start location for the given resource. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + + + +\end_inset + + \end_layout \begin_layout Subsection