pkgsrc-Users archive

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

Update to database/prometheus SMF file



Hi,

I'm running Prometheus in an OmniOS zone but the service didn't want to
start because of "enable to access" errors. After digging a bit, it
seems the service is started as anonymous when the data files belongs to
the prometheus user.

When applied the following patch to the SMF file, the service starts and
runs as expected.

# diff -U2 /tmp/prometheus.xml.orig /tmp/prometheus.xml
--- /tmp/prometheus.xml.orig    Sun Dec 15 00:04:28 2024
+++ /tmp/prometheus.xml Sun Dec 15 00:17:30 2024
@@ -11,6 +11,6 @@
<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
-    <method_context>
-      <method_credential group='nobody' privileges='basic,net_privaddr' user='nobody'/>
+    <method_context working_directory="/var/lib/prometheus">
+      <method_credential group='prometheus' user='prometheus'/>
</method_context>
<exec_method name='start' type='method' exec='/opt/local/bin/prometheus --storage.tsdb.path=/var/lib/prometheus/data --config.file=/opt/local/etc/prometheus/prometheus.yml &amp;' timeout_seconds='30'/>

Hope it helps,
Joel C.


Home | Main Index | Thread Index | Old Index