mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-02-11 17:30:46 +01:00
Upgrade mycroft-service to use systemd notify through previous scripts
This commit is contained in:
parent
d3211bbfbf
commit
196affff22
@ -2,14 +2,23 @@
|
||||
Description=Mycroft Audio
|
||||
PartOf=mycroft.service
|
||||
After=mycroft.service
|
||||
After=mycroft-messagebus.service
|
||||
|
||||
[Service]
|
||||
User=mycroft
|
||||
Type=notify
|
||||
WorkingDirectory=/home/mycroft
|
||||
ExecStart=mycroft-audio
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/home/mycroft/.local/share/systemd/mycroft-systemd_audio.py
|
||||
StandardOutput=file:/var/log/mycroft/audio.log
|
||||
StandardError=file:/var/log/mycroft/audio.error.log
|
||||
TimeoutStartSec=1m
|
||||
TimeoutStopSec=1m
|
||||
Restart=on-failure
|
||||
StartLimitInterval=5min
|
||||
StartLimitBurst=4
|
||||
#StartLimitAction=reboot-force
|
||||
#WatchdogSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=mycroft.service
|
||||
|
@ -6,11 +6,19 @@ After=mycroft-messagebus.service
|
||||
|
||||
[Service]
|
||||
User=mycroft
|
||||
Type=notify
|
||||
WorkingDirectory=/home/mycroft
|
||||
ExecStart=mycroft-enclosure-client
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/home/mycroft/.local/share/systemd/mycroft-systemd_enclosure.py
|
||||
StandardOutput=file:/var/log/mycroft/enclosure.log
|
||||
StandardError=file:/var/log/mycroft/enclosure.error.log
|
||||
TimeoutStartSec=1m
|
||||
TimeoutStopSec=1m
|
||||
Restart=on-failure
|
||||
StartLimitInterval=5min
|
||||
StartLimitBurst=4
|
||||
#StartLimitAction=reboot-force
|
||||
#WatchdogSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=mycroft.service
|
||||
|
@ -5,11 +5,19 @@ After=mycroft.service
|
||||
|
||||
[Service]
|
||||
User=mycroft
|
||||
Type=notify
|
||||
WorkingDirectory=/home/mycroft
|
||||
ExecStart=mycroft-messagebus
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/home/mycroft/.local/share/systemd/mycroft-systemd_messagebus.py
|
||||
StandardOutput=file:/var/log/mycroft/bus.log
|
||||
StandardError=file:/var/log/mycroft/bus.error.log
|
||||
TimeoutStartSec=1m
|
||||
TimeoutStopSec=1m
|
||||
Restart=on-failure
|
||||
StartLimitInterval=5min
|
||||
StartLimitBurst=4
|
||||
#StartLimitAction=reboot-force
|
||||
#WatchdogSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=mycroft.service
|
||||
|
@ -11,6 +11,18 @@ MYCROFT_SERVICE_LICENSE = Apache License 2.0
|
||||
MYCROFT_SERVICE_LICENSE_FILES = LICENSE
|
||||
|
||||
define MYCROFT_SERVICE_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)/home/mycroft/.local/share/systemd
|
||||
$(INSTALL) -m 0755 $(@D)/mycroft-systemd_audio.py \
|
||||
$(TARGET_DIR)/home/mycroft/.local/share/systemd/mycroft-systemd_audio.py
|
||||
$(INSTALL) -m 0755 $(@D)/mycroft-systemd_enclosure.py \
|
||||
$(TARGET_DIR)/home/mycroft/.local/share/systemd/mycroft-systemd_enclosure.py
|
||||
$(INSTALL) -m 0755 $(@D)/mycroft-systemd_messagebus.py \
|
||||
$(TARGET_DIR)/home/mycroft/.local/share/systemd/mycroft-systemd_messagebus.py
|
||||
$(INSTALL) -m 0755 $(@D)/mycroft-systemd_skills.py \
|
||||
$(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) -D -m 644 $(@D)/mycroft.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/mycroft.service
|
||||
$(INSTALL) -D -m 644 $(@D)/mycroft-messagebus.service \
|
||||
|
@ -2,14 +2,24 @@
|
||||
Description=Mycroft Skills
|
||||
PartOf=mycroft.service
|
||||
After=mycroft.service
|
||||
After=mycroft-messagebus.service
|
||||
After=mycroft-audio.service
|
||||
|
||||
[Service]
|
||||
User=mycroft
|
||||
Type=notify
|
||||
WorkingDirectory=/home/mycroft
|
||||
ExecStart=mycroft-skills
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/home/mycroft/.local/share/systemd/mycroft-systemd_skills.py
|
||||
StandardOutput=file:/var/log/mycroft/skills.log
|
||||
StandardError=file:/var/log/mycroft/skills.error.log
|
||||
TimeoutStartSec=1m
|
||||
TimeoutStopSec=1m
|
||||
Restart=on-failure
|
||||
StartLimitInterval=5min
|
||||
StartLimitBurst=4
|
||||
#StartLimitAction=reboot-force
|
||||
#WatchdogSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=mycroft.service
|
||||
|
30
buildroot-external/package/mycroft-service/mycroft-systemd_audio.py
Executable file
30
buildroot-external/package/mycroft-service/mycroft-systemd_audio.py
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
##########################################################################
|
||||
# mycroft-systemd_audio.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.audio.__main__ import main
|
||||
|
||||
n = sdnotify.SystemdNotifier()
|
||||
|
||||
def notify_ready():
|
||||
n.notify('READY=1')
|
||||
print('Startup of Mycroft Audio service complete')
|
||||
|
||||
def notify_stopping():
|
||||
n.notify('STOPPING=1')
|
||||
print('Stopping the Mycroft Audio service')
|
||||
|
||||
main(ready_hook=notify_ready, stopping_hook=notify_stopping)
|
30
buildroot-external/package/mycroft-service/mycroft-systemd_enclosure.py
Executable file
30
buildroot-external/package/mycroft-service/mycroft-systemd_enclosure.py
Executable 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.client.enclosure.__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)
|
30
buildroot-external/package/mycroft-service/mycroft-systemd_messagebus.py
Executable file
30
buildroot-external/package/mycroft-service/mycroft-systemd_messagebus.py
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
##########################################################################
|
||||
# mycroft-systemd_messagebus.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.messagebus.service.__main__ import main
|
||||
|
||||
n = sdnotify.SystemdNotifier()
|
||||
|
||||
def notify_ready():
|
||||
n.notify('READY=1')
|
||||
print('Startup of Mycroft Messagebus service complete')
|
||||
|
||||
def notify_stopping():
|
||||
n.notify('STOPPING=1')
|
||||
print('Stopping the Mycroft Messagebus service')
|
||||
|
||||
main(ready_hook=notify_ready, stopping_hook=notify_stopping)
|
30
buildroot-external/package/mycroft-service/mycroft-systemd_skills.py
Executable file
30
buildroot-external/package/mycroft-service/mycroft-systemd_skills.py
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
##########################################################################
|
||||
# mycroft-systemd_skills.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.skills.__main__ import main
|
||||
|
||||
n = sdnotify.SystemdNotifier()
|
||||
|
||||
def notify_ready():
|
||||
n.notify('READY=1')
|
||||
print('Startup of Mycroft Skills service complete')
|
||||
|
||||
def notify_stopping():
|
||||
n.notify('STOPPING=1')
|
||||
print('Stopping the Mycroft Skills service')
|
||||
|
||||
main(ready_hook=notify_ready, stopping_hook=notify_stopping)
|
30
buildroot-external/package/mycroft-service/mycroft-systemd_voice.py
Executable file
30
buildroot-external/package/mycroft-service/mycroft-systemd_voice.py
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
##########################################################################
|
||||
# mycroft-systemd_voice.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.client.speech.__main__ import main
|
||||
|
||||
n = sdnotify.SystemdNotifier()
|
||||
|
||||
def notify_ready():
|
||||
n.notify('READY=1')
|
||||
print('Startup of Mycroft Voice service complete')
|
||||
|
||||
def notify_stopping():
|
||||
n.notify('STOPPING=1')
|
||||
print('Stopping the Mycroft Voice service')
|
||||
|
||||
main(ready_hook=notify_ready, stopping_hook=notify_stopping)
|
Loading…
x
Reference in New Issue
Block a user