Add new enclosure-gui systemd service files

This commit is contained in:
j1nx 2022-01-24 20:39:08 +01:00
parent 72f9329160
commit 0608422e41
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,24 @@
[Unit]
Description=Mycroft Enclosure
PartOf=mycroft.service
After=mycroft.service
After=mycroft-messagebus.service
[Service]
User=mycroft
Type=notify
WorkingDirectory=/home/mycroft
Environment=PYTHONUNBUFFERED=1
ExecStart=/home/mycroft/.local/share/systemd/mycroft-systemd_gui.py
StandardOutput=append:/var/log/mycroft/enclosure_gui.log
StandardError=file:/var/log/mycroft/enclosure_gui.error.log
TimeoutStartSec=1m
TimeoutStopSec=1m
Restart=on-failure
StartLimitInterval=5min
StartLimitBurst=4
#StartLimitAction=reboot-force
#WatchdogSec=30s
[Install]
WantedBy=mycroft.service

View File

@ -22,6 +22,8 @@ define MYCROFT_SERVICE_INSTALL_TARGET_CMDS
$(TARGET_DIR)/home/mycroft/.local/share/systemd/mycroft-systemd_skills.py
$(INSTALL) -m 0755 $(@D)/mycroft-systemd_voice.py \
$(TARGET_DIR)/home/mycroft/.local/share/systemd/mycroft-systemd_voice.py
$(INSTALL) -m 0755 $(@D)/mycroft-systemd_gui.py \
$(TARGET_DIR)/home/mycroft/.local/share/systemd/mycroft-systemd_gui.py
$(INSTALL) -D -m 644 $(@D)/mycroft.service \
$(TARGET_DIR)/usr/lib/systemd/system/mycroft.service
@ -37,6 +39,8 @@ define MYCROFT_SERVICE_INSTALL_TARGET_CMDS
$(TARGET_DIR)/usr/lib/systemd/system/mycroft-skills.service
$(INSTALL) -D -m 644 $(@D)/mycroft-gui.service \
$(TARGET_DIR)/usr/lib/systemd/system/mycroft-gui.service
$(INSTALL) -D -m 644 $(@D)/mycroft-enclosure-gui.service \
$(TARGET_DIR)/usr/lib/systemd/system/mycroft-enclosure-gui.service
endef
$(eval $(generic-package))

View File

@ -0,0 +1,30 @@
#!/usr/bin/env python
##########################################################################
# mycroft-systemd_enclosure.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
import sdnotify
from mycroft.gui.__main__ import main
n = sdnotify.SystemdNotifier()
def notify_ready():
n.notify('READY=1')
print('Startup of Mycroft Enclosure service complete')
def notify_stopping():
n.notify('STOPPING=1')
print('Stopping the Mycroft Enclosure service')
main(ready_hook=notify_ready, stopping_hook=notify_stopping)

View File

@ -17,6 +17,7 @@ enable mycroft-audio.service
enable mycroft-skills.service
enable mycroft-enclosure.service
enable mycroft-gui.service
enable mycroft-enclosure-gui.service
enable ovos-splash-quit.service
enable local-backend.service