laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/30019 )
Change subject: add a documentation snippet for systemd services ......................................................................
add a documentation snippet for systemd services
... this can be included from the various user manuals to insert some general language about the systemd service units we ship, and a few key systemd commands to get users started.
Change-Id: I8b04047cbc4097676d69fad794bb3139c05a4a5f --- A common/snippets/systemd.adoc 1 file changed, 69 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/19/30019/1
diff --git a/common/snippets/systemd.adoc b/common/snippets/systemd.adoc new file mode 100644 index 0000000..7510ed9 --- /dev/null +++ b/common/snippets/systemd.adoc @@ -0,0 +1,69 @@ +=== Running as a systemd service + +Most modern GNU/Linux distributions use `systemd` to manage processes. +We provide an example systemd service unit file in the +`contrib/systemd/` sub-directory of the source code. + +Pleas see your distribution documentation and/or the generic systemd +user manuals for more in-depth information. + +The file assumes your configuration file is stored in `/etc/osmocom/`, but +feel free to adjust this according to your local environment. + +This service unit file is also what is used (and installed) by the +official dpkg and rpm packages published by Osmocom. For more +information, see +https://osmocom.org/projects/cellular-infrastructure/wiki/Binary_Packages + +On a system utilizing this systemd service unit, you can use the +following standard commands: + +==== Starting a service + +.Example shell command to start the osmo-bsc service +---- +# systemctl start osmo-bsc +---- +==== Stopping a service + +.Example shell command to stop the osmo-bsc service +---- +# systemctl stop osmo-bsc +---- + +==== Enabling a service for automatic start on boot + +.Example shell command to enable the osmo-bsc service +---- +# systemctl enable osmo-bsc +---- + +Note that this will only affect service starting at the next system +boot; it will not start the service if it is not running right now. + +==== Disabling a service from automatic start on boot + +.Example shell command to disable the osmo-bsc service +---- +# systemctl disable osmo-bsc +---- + + +==== Checking current status of a service + +.Example shell command to check the status of osmo-e1d +---- +# systemctl status osmo-e1d +● osmo-e1d.service - Osmocom E1 Interface Daemon + Loaded: loaded (/etc/systemd/system/osmo-e1d.service; enabled; vendor preset: enabled) + Active: active (running) since Tue 2022-11-01 13:12:54 CET; 4 days ago + Main PID: 629 (osmo-e1d) + Tasks: 2 (limit: 4673) + Memory: 2.0M + CPU: 6min 8.464s + CGroup: /system.slice/osmo-e1d.service + └─629 /usr/local/bin/osmo-e1d -c /etc/osmocom/osmo-e1d.cfg + +Nov 03 19:22:56 divo osmo-e1d[629]: Thu Nov 3 19:22:56 2022 DE1D usb.c:734 (I0) GPS antenna status ch> +Nov 03 19:23:00 divo osmo-e1d[629]: Thu Nov 3 19:23:00 2022 DE1D usb.c:734 (I0) GPS antenna status +----