pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Update sysutils/monit with SMF and dedicated user



Hello,

I have started running Monit on an OmniOS (illumos) zone. I noticed that
there were no SMF available. So I wrote one for my own usage. Also, it
doesn´t seem to run as an unprivileged user so I tuned it to do so.

My overall process was:
```
# pkgin in monit

# groupadd -g 101 monit
# useradd -u 101 -g 101 -d /opt/local/etc/monit -s /usr/bin/false -c "monit user" monit

# chown monit:monit /opt/local/etc/monit /opt/local/etc/monit/monitrc
# chmod 0700 /opt/local/etc/monit/monitrc

# vi monit-manifest.xml
# svccfg import monit-manifest.xml
# svcadm enable monit

# svcs -l svc:/pkgsrc/monit
fmri         svc:/pkgsrc/monit:default
name         Monit utility for managing and monitoring, processes, files, directories and devices
enabled      true
state        online
next_state   none
state_time   October 22, 2025 at 01:26:53 PM UTC
logfile      /var/svc/log/pkgsrc-monit:default.log
restarter    svc:/system/svc/restarter:default
contract_id  1178
dependency   require_all/error svc:/milestone/network:default (online)
dependency   require_all/error svc:/system/filesystem/local (online)

# tail /var/svc/log/pkgsrc-monit:default.log
[ Oct 22 13:26:53 Enabled. ]
[ Oct 22 13:26:53 Executing start method ("/opt/local/bin/monit &"). ]
[ Oct 22 13:26:53 Method "start" exited with status 0. ]
 New Monit id: 67118f6daa2b00e19ee4dd044d303a57
 Stored in '/opt/local/etc/monit/.monit.id'
Starting Monit 5.33.0 daemon with http interface at [192.0.2.30]:2812
```

Using `/opt/local/etc/monit` as a home directory for the service is ok
here as it runs alone in a dedicated zone. But it may not suit NetBSD
and Linux installation. I am not sure what a proper directory would be -
maybe `${VARBASE}/db/monit`?

Anyway, here's the SMF attached if you feel like making it available.

Regards,
Joel C.

Attachment: monit-manifest.xml.gz
Description: application/gunzip



Home | Main Index | Thread Index | Old Index