Skip to content

Commit

Permalink
Always enable the services
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdewid committed Aug 16, 2023
1 parent 1ad2061 commit 13c77ca
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
39 changes: 24 additions & 15 deletions contrib/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,37 @@ if [ ! -e "$FILE_PATH" ]; then
echo "..done"
fi

# Reload the systemd daemon to pick up the new service files
if command -v systemctl &> /dev/null; then
echo -n "Reloading systemd units.."
systemctl daemon-reload
echo "..done"
fi

# Load the udev rules
if command -v udevadm &> /dev/null; then
echo -n "Reloading udev rules.."
udevadm control --reload-rules
echo "..done"
fi

# Restart the glonax services
if command -v systemctl &> /dev/null; then
echo -n "Restarting glonax services.."
if systemctl is-active glonax-proxy.service &> /dev/null; then
systemctl restart glonax-proxy.service
fi
if systemctl is-active glonax-agent.service &> /dev/null; then
systemctl restart glonax-agent.service
start_glonax_service() {
local SERVICE_NAME="$1"

if systemctl is-active "$SERVICE_NAME" &> /dev/null; then
echo -n "Restarting $SERVICE_NAME.."
systemctl restart "$SERVICE_NAME"
echo "..done"
else
echo -n "Starting $SERVICE_NAME.."
systemctl start "$SERVICE_NAME"
echo "..done"
fi
echo -n "Enabling $SERVICE_NAME.."
systemctl enable "$SERVICE_NAME"
echo "..done"
}

# Start the glonax services
if command -v systemctl &> /dev/null; then
# Reload the systemd daemon to pick up the new service files
echo -n "Reloading systemd units.."
systemctl daemon-reload
echo "..done"

start_glonax_service glonax-proxy.service
start_glonax_service glonax-agent.service
fi
1 change: 0 additions & 1 deletion contrib/systemd/glonax-agent.service
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ RestartSec=2
Nice=5
User=glonax
Group=glonax
ExecStartPre=/bin/sleep 10
ExecStart=/usr/local/bin/glonax-agent --daemon
PrivateTmp=true

Expand Down
1 change: 0 additions & 1 deletion contrib/systemd/glonax-gnss.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Restart=always
RestartSec=2
User=glonax
Group=glonax
ExecStartPre=/bin/sleep 5
ExecStart=/usr/local/bin/glonax-gnssd --daemon /dev/ttyACM0
PrivateTmp=true

Expand Down
4 changes: 2 additions & 2 deletions contrib/systemd/glonax-input.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Description=Glonax Input Event Handler
StartLimitIntervalSec=5
StartLimitBurst=5
After=bluetooth.target
#After=bluetooth.target
ConditionPathExists=/dev/input/js0

[Service]
WorkingDirectory=/var/lib/glonax
Restart=always
RestartSec=2
ExecStart=/usr/local/bin/glonax-inputd --daemon /dev/input/js0
ExecStart=/usr/local/bin/glonax-input --daemon /dev/input/js0
PrivateTmp=true

[Install]
Expand Down

0 comments on commit 13c77ca

Please sign in to comment.