mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 21:19:35 +00:00
selfcheck.py: make selfcheck work if there is no systemd module
This commit is contained in:
@@ -16,7 +16,6 @@ import traceback
|
||||
from threading import Event
|
||||
import numpy
|
||||
import rospy
|
||||
from systemd import journal
|
||||
import tf2_ros
|
||||
import tf2_geometry_msgs
|
||||
from pymavlink import mavutil
|
||||
@@ -620,6 +619,12 @@ def check_clever_service():
|
||||
failure('clever.service is not running, try sudo systemctl restart clever')
|
||||
return
|
||||
|
||||
try:
|
||||
from systemd import journal
|
||||
except ImportError:
|
||||
failure('no python-systemd package, not the Clever image?')
|
||||
return
|
||||
|
||||
j = journal.Reader()
|
||||
j.this_boot()
|
||||
j.add_match(_SYSTEMD_UNIT='clever.service')
|
||||
|
||||
Reference in New Issue
Block a user