Skip to content

Commit

Permalink
Merge pull request #28 from thin-edge/fix-install-file-not-found-message
Browse files Browse the repository at this point in the history
fix(install): check if systemd service definition exists first
  • Loading branch information
reubenmiller authored Nov 21, 2024
2 parents 31d0718 + df3da87 commit fb1148d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/packaging/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ fi

# newer monit service definitions are sometimes too strict on the "hardening" of the service
# which results in the "tedge reconnect c8y" command failing.
if grep -q "CapabilityBoundingSet=" /usr/lib/systemd/system/monit.service; then
if [ ! -e /etc/systemd/system/monit.service ]; then
echo "Using custom monit.service definition with custom capabilities set"
ln -sf /usr/share/tedge-monit-setup/service/monit.service /etc/systemd/system/monit.service
if [ -f /usr/lib/systemd/system/monit.service ]; then
if grep -q "CapabilityBoundingSet=" /usr/lib/systemd/system/monit.service; then
if [ ! -e /etc/systemd/system/monit.service ]; then
echo "Using custom monit.service definition with custom capabilities set"
ln -sf /usr/share/tedge-monit-setup/service/monit.service /etc/systemd/system/monit.service
fi
fi
fi

Expand Down

0 comments on commit fb1148d

Please sign in to comment.