From 2131d22144d22c84d9643f96d9b1c8db79c6c6b0 Mon Sep 17 00:00:00 2001 From: Aditya Mehra Date: Fri, 24 Feb 2023 12:33:07 +1030 Subject: [PATCH 1/4] add setup and running services doc --- docs/setup_ovos_services.md | 191 ++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 docs/setup_ovos_services.md diff --git a/docs/setup_ovos_services.md b/docs/setup_ovos_services.md new file mode 100644 index 00000000..2a553eec --- /dev/null +++ b/docs/setup_ovos_services.md @@ -0,0 +1,191 @@ +# Running & Setting Up OVOS Services + +OpenVoiceOS is a software stack that includes seven important services, with some being optional, depending on the platform or environment. If you are a developer or would like to quickly test OpenVoiceOS for debugging purposes, you can run each service separately in a terminal. However, for users, distributions, and packagers, it is recommended to use systemd or any other init service that their userland supports for launching and managing OpenVoiceOS services. + +### Here are the commands for launching each of the services from the CLI: + + - Launching the Messagebus service (required): python3 -m mycroft.messagebus.service + - Launching the Skills service (required): python3 -m mycroft.skills + - Launching the PHAL service (required): python3 -m ovos_PHAL + - Launching the Audio service (required): python3 -m mycroft.audio + - Launching the Voice service (required): python3 -m mycroft.client.speech + - Launching the GUI service (optional): python3 -m mycroft.gui + - Launching the CLI service (optional): python3 -m mycroft.client.text + +OpenVoiceOS services can be set up as SYSTEM or USER systemd services. The choice of which type to use and how to set them up is left up to the user, packager, and distributions. Keep in mind that these service scripts are just examples and may require changes based on your requirements. + +### Setup the OpenVoiceOS service: +- Create a service file called "ovos.service" under "/usr/lib/systemd/user/" with the following contents: + +``` +[Unit] +Description=OpenVoiceOS Software stack. +Requires=ovos-messagebus.service +Requires=ovos-skills.service +Requires=ovos-audio.service +Requires=ovos-voice.service +Requires=ovos-gui.service +Requires=ovos-phal.service + +[Service] +Type=simple +ExecStart=/bin/true +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target +``` + +Here are the service files required for each of the individual services: + +### Setting up Messagebus service as a user service: +- Create a service file called "ovos-messagebus.service" under "/usr/lib/systemd/user/" with the following contents: + +``` +[Unit] +Description=OpenVoiceOS Messagebus +Requires=ovos.service +PartOf=ovos.service + +[Service] +Type=simple +ExecStart=/usr/bin/python -m mycroft.messagebus.service +TimeoutStartSec=1m +TimeoutStopSec=1m +Restart=on-failure +StartLimitInterval=5min +StartLimitBurst=4 +StandardOutput=append:/var/log/ovos/bus.log +StandardError=file:/var/log/ovos/bus.error.log + +[Install] +WantedBy=ovos.service +``` + +### Setting up Skills service: +- Create a service file called "ovos-skills.service" under "/usr/lib/systemd/user/" with the following contents: + +``` +[Unit] +Description=OpenVoiceOS Skills +PartOf=ovos.service +Requires=ovos-messagebus.service + +[Service] +Type=simple +ExecStart=/usr/bin/python -m mycroft.skills +TimeoutStartSec=1m +TimeoutStopSec=1m +Restart=on-failure +StartLimitInterval=5min +StartLimitBurst=4 +StandardOutput=append:/var/log/ovos/skills.log +StandardError=file:/var/log/ovos/skills.error.log + +[Install] +WantedBy=ovos.service +``` + +### Setting up PHAL service: +- Create a service file called "ovos-phal.service" under "/usr/lib/systemd/user/" with the following contents: + +``` +[Unit] +Description=OVOS PHAL +PartOf=ovos.service +Requires=ovos-messagebus.service + + +[Service] +Type=simple +ExecStart=/usr/bin/python -m ovos_PHAL +TimeoutStartSec=1m +TimeoutStopSec=1m +Restart=on-failure +StartLimitInterval=5min +StartLimitBurst=4 +StandardOutput=append:/var/log/ovos/phal.log +StandardError=file:/var/log/ovos/phal.error.log + +[Install] +WantedBy=ovos.service +``` + +### Setting up Audio service: +- Create a service file called "ovos-audio.service" under "/usr/lib/systemd/user/" with the following contents: + +``` +[Unit] +Description=OVOS Audio +PartOf=ovos.service +Requires=ovos-messagebus.service + + +[Service] +Type=simple +ExecStart=/usr/bin/python -m mycroft.audio +TimeoutStartSec=1m +TimeoutStopSec=1m +Restart=on-failure +StartLimitInterval=5min +StartLimitBurst=4 +StandardOutput=append:/var/log/ovos/audio.log +StandardError=file:/var/log/ovos/audio.error.log + +[Install] +WantedBy=ovos.service +``` + +### Setting up Voice service: +- Create a service file called "ovos-voice.service" under "/usr/lib/systemd/user/" with the following contents: + +``` +[Unit] +Description=OVOS Voice +PartOf=ovos.service +Requires=ovos-messagebus.service + + +[Service] +Type=simple +ExecStart=/usr/bin/python -m mycroft.client.speech +TimeoutStartSec=1m +TimeoutStopSec=1m +Restart=on-failure +StartLimitInterval=5min +StartLimitBurst=4 +StandardOutput=append:/var/log/ovos/voice.log +StandardError=file:/var/log/ovos/voice.error.log + +[Install] +WantedBy=ovos.service +``` + +### Setting up GUI service: +- Create a service file called "ovos-gui.service" under "/usr/lib/systemd/user/" with the following contents: + +``` +[Unit] +Description=OVOS Gui +PartOf=ovos.service +Requires=ovos-messagebus.service + + +[Service] +Type=simple +ExecStart=/usr/bin/python -m mycroft.gui +TimeoutStartSec=1m +TimeoutStopSec=1m +Restart=on-failure +StartLimitInterval=5min +StartLimitBurst=4 +StandardOutput=append:/var/log/ovos/ovos-gui.log +StandardError=file:/var/log/ovos/ovos-gui.error.log + +[Install] +WantedBy=ovos.service +``` + +### Using helper scripts + +You can find helper scripts such as **start-mycroft.sh** and **stop-mycroft.sh** on this website: https://github.com/OpenVoiceOS/scripts. These scripts are designed to mimic a daemon and manage multiple OVOS services. However, please note that they are optional and should be used with care. They are not the most recommended method for running OVOS services. From 5bcda59352257f702f84722c730090dd438a2beb Mon Sep 17 00:00:00 2001 From: Aditya Mehra Date: Fri, 24 Feb 2023 13:47:53 +1030 Subject: [PATCH 2/4] update doc --- docs/setup_ovos_services.md | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/docs/setup_ovos_services.md b/docs/setup_ovos_services.md index 2a553eec..34dd367c 100644 --- a/docs/setup_ovos_services.md +++ b/docs/setup_ovos_services.md @@ -4,13 +4,12 @@ OpenVoiceOS is a software stack that includes seven important services, with som ### Here are the commands for launching each of the services from the CLI: - - Launching the Messagebus service (required): python3 -m mycroft.messagebus.service - - Launching the Skills service (required): python3 -m mycroft.skills - - Launching the PHAL service (required): python3 -m ovos_PHAL - - Launching the Audio service (required): python3 -m mycroft.audio - - Launching the Voice service (required): python3 -m mycroft.client.speech - - Launching the GUI service (optional): python3 -m mycroft.gui - - Launching the CLI service (optional): python3 -m mycroft.client.text + - Launching the Messagebus service: python3 -m mycroft.messagebus.service + - Launching the Skills service: python3 -m mycroft.skills + - Launching the PHAL service: python3 -m ovos_PHAL + - Launching the Audio service: python3 -m mycroft.audio + - Launching the Voice service: python3 -m mycroft.client.speech + - Launching the GUI service: python3 -m mycroft.gui OpenVoiceOS services can be set up as SYSTEM or USER systemd services. The choice of which type to use and how to set them up is left up to the user, packager, and distributions. Keep in mind that these service scripts are just examples and may require changes based on your requirements. @@ -55,8 +54,6 @@ TimeoutStopSec=1m Restart=on-failure StartLimitInterval=5min StartLimitBurst=4 -StandardOutput=append:/var/log/ovos/bus.log -StandardError=file:/var/log/ovos/bus.error.log [Install] WantedBy=ovos.service @@ -79,8 +76,6 @@ TimeoutStopSec=1m Restart=on-failure StartLimitInterval=5min StartLimitBurst=4 -StandardOutput=append:/var/log/ovos/skills.log -StandardError=file:/var/log/ovos/skills.error.log [Install] WantedBy=ovos.service @@ -104,8 +99,6 @@ TimeoutStopSec=1m Restart=on-failure StartLimitInterval=5min StartLimitBurst=4 -StandardOutput=append:/var/log/ovos/phal.log -StandardError=file:/var/log/ovos/phal.error.log [Install] WantedBy=ovos.service @@ -129,8 +122,6 @@ TimeoutStopSec=1m Restart=on-failure StartLimitInterval=5min StartLimitBurst=4 -StandardOutput=append:/var/log/ovos/audio.log -StandardError=file:/var/log/ovos/audio.error.log [Install] WantedBy=ovos.service @@ -154,8 +145,6 @@ TimeoutStopSec=1m Restart=on-failure StartLimitInterval=5min StartLimitBurst=4 -StandardOutput=append:/var/log/ovos/voice.log -StandardError=file:/var/log/ovos/voice.error.log [Install] WantedBy=ovos.service @@ -179,8 +168,6 @@ TimeoutStopSec=1m Restart=on-failure StartLimitInterval=5min StartLimitBurst=4 -StandardOutput=append:/var/log/ovos/ovos-gui.log -StandardError=file:/var/log/ovos/ovos-gui.error.log [Install] WantedBy=ovos.service From 1c20edb887bb95cb05aa675dbd33a0158c9e7020 Mon Sep 17 00:00:00 2001 From: Aditya Mehra Date: Fri, 24 Feb 2023 13:49:16 +1030 Subject: [PATCH 3/4] update docs --- docs/setup_ovos_services.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setup_ovos_services.md b/docs/setup_ovos_services.md index 34dd367c..7a97a9fb 100644 --- a/docs/setup_ovos_services.md +++ b/docs/setup_ovos_services.md @@ -1,6 +1,6 @@ # Running & Setting Up OVOS Services -OpenVoiceOS is a software stack that includes seven important services, with some being optional, depending on the platform or environment. If you are a developer or would like to quickly test OpenVoiceOS for debugging purposes, you can run each service separately in a terminal. However, for users, distributions, and packagers, it is recommended to use systemd or any other init service that their userland supports for launching and managing OpenVoiceOS services. +OpenVoiceOS is a software stack that includes six important services, with some being optional, depending on the platform or environment. If you are a developer or would like to quickly test OpenVoiceOS for debugging purposes, you can run each service separately in a terminal. However, for users, distributions, and packagers, it is recommended to use systemd or any other init service that their userland supports for launching and managing OpenVoiceOS services. ### Here are the commands for launching each of the services from the CLI: From 0f75856bf2cfa6a6a2802a663fd44396d1aea3db Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:47:30 +0000 Subject: [PATCH 4/4] Update mkdocs.yml --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index 56f50e60..d971828f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,6 +24,7 @@ nav: - KDE Connect: kdeconnect.md - OVOS-core: - Introduction: core.md + - Startup: setup_ovos_services.md - Bus: bus_service.md - Skills: skills_service.md - Speech: speech_service.md