Skip to content

Commit

Permalink
Merge pull request #29 from thin-edge/fix-rasp-pi-monitrc-config
Browse files Browse the repository at this point in the history
fix(install): remove default monitrc line which causes service to fail
  • Loading branch information
reubenmiller authored Nov 21, 2024
2 parents fb1148d + 439762e commit e2afd78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/packaging/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ fi
# In Yocto, monit looks at the /etc/monit.d/ directory
# instead of /etc/monit/conf.d/, so let's add the other directory to as well (for normalization)
if [ -f "$MONITRC" ]; then

# Some debian packages (maybe a Raspberry Pi APT mirror, monit 5.33.0) includes a buggy
# default monitrc configuration where the line 'include /etc/monit/conf.d/*' causes the service not to start.
# So delete the line as it will be replaced with a similar line afterwards
sed -i 's|^include /etc/monit/conf.d/\*$||g' "$MONITRC"

if ! grep -q "include /etc/monit/conf.d/\*" "$MONITRC"; then
echo "Adding /etc/monit/conf.d/ to the monit config ($MONITRC)" >&2
echo 'include /etc/monit/conf.d/*.conf' >> "$MONITRC"
Expand Down

0 comments on commit e2afd78

Please sign in to comment.