Skip to content

Commit

Permalink
rrdd: Add .service and config files
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Sultanov <[email protected]>
  • Loading branch information
last-genius committed Oct 1, 2024
1 parent 6bf1d74 commit aa631b9
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,23 @@ install:
$(IDATA) xapi-nbd.path $(DESTDIR)/usr/lib/systemd/system/xapi-nbd.path
$(IDATA) 10-stunnel-increase-number-of-file-descriptors.conf $(DESTDIR)/etc/systemd/system/[email protected]/10-stunnel-increase-number-of-file-descriptors.conf
$(IDATA) 11-stunnel-gencert.conf $(DESTDIR)/etc/systemd/system/[email protected]/11-stunnel-gencert.conf
$(IDATA) xcp-rrdd.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd.service
$(IDATA) xcp-rrdd-xenpm.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd-xenpm.service
$(IDATA) xcp-rrdd-iostat.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd-iostat.service
$(IDATA) xcp-rrdd-squeezed.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd-squeezed.service
$(IDATA) xcp-rrdd-squeezed.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd-squeezed.service
$(IDATA) xcp-rrdd-dcmi.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd-dcmi.service
$(IDATA) xcp-rrdd-cpu.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd-cpu.service
$(IDATA) xcp-rrdd-netdev.service $(DESTDIR)/usr/lib/systemd/system/xcp-rrdd-netdev.service
mkdir -p $(DESTDIR)$(ETCXENDIR)/master.d
$(IPROG) on-master-start $(DESTDIR)$(ETCXENDIR)/master.d/01-example
$(IPROG) mpathalert-daemon $(DESTDIR)$(ETCXENDIR)/master.d/03-mpathalert-daemon
mkdir -p $(DESTDIR)/etc/sysconfig
$(IPROG) sysconfig-xapi $(DESTDIR)/etc/sysconfig/xapi
$(IPROG) xcp-rrdd-sysconfig $(DESTDIR)/etc/sysconfig/xcp-rrdd
$(IPROG) xcp-rrdd-conf $(DESTDIR)/etc/xcp-rrdd.conf
mkdir -p $(DESTDIR)/usr/lib/tmpfiles.d
$(IPROG) xcp-rrdd-tmp $(DESTDIR)/usr/lib/tmpfiles.d/xcp-rrdd.conf
$(IPROG) nbd-firewall-config.sh $(DESTDIR)$(LIBEXECDIR)
$(IPROG) update-ca-bundle.sh $(DESTDIR)$(OPTDIR)/bin
mkdir -p $(DESTDIR)$(OPTDIR)/debug
Expand Down
6 changes: 6 additions & 0 deletions scripts/xcp-rrdd-conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The xcp-rrdd config file

inventory = /etc/xensource-inventory

disable-logging-for = http
loglevel = info
15 changes: 15 additions & 0 deletions scripts/xcp-rrdd-cpu.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=XCP RRD daemon CPU plugin
After=xcp-rrdd.service
Requires=xcp-rrdd.service

[Service]
ExecStart=/opt/xensource/libexec/xcp-rrdd-plugins/xcp-rrdd-cpu
StandardError=null
# restart but fail if more than 5 failures in 30s
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=30s

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions scripts/xcp-rrdd-dcmi.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=XCP RRD daemon IPMI DCMI power plugin
After=xcp-rrdd.service
Requires=xcp-rrdd.service

[Service]
ExecStart=/opt/xensource/libexec/xcp-rrdd-plugins/xcp-rrdd-dcmi
StandardError=null
# restart but fail if more than 5 failures in 30s
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=30s

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions scripts/xcp-rrdd-iostat.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=XCP RRD daemon iostat plugin
After=xcp-rrdd.service
Requires=xcp-rrdd.service

[Service]
ExecStart=/opt/xensource/libexec/xcp-rrdd-plugins/xcp-rrdd-iostat
StandardError=null
# restart but fail if more than 5 failures in 30s
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=30s

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions scripts/xcp-rrdd-netdev.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=XCP RRD daemon network plugin
After=xcp-rrdd.service
Requires=xcp-rrdd.service

[Service]
ExecStart=/opt/xensource/libexec/xcp-rrdd-plugins/xcp-rrdd-netdev
StandardError=null
# restart but fail if more than 5 failures in 30s
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=30s

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions scripts/xcp-rrdd-squeezed.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=XCP RRD daemon squeezed plugin
After=xcp-rrdd.service
Requires=xcp-rrdd.service

[Service]
ExecStart=/opt/xensource/libexec/xcp-rrdd-plugins/xcp-rrdd-squeezed
StandardError=null
# restart but fail if more than 5 failures in 30s
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=30s

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions scripts/xcp-rrdd-sysconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Additional options for the XCP RRD deamon.
# XCP_RRDD_OPTIONS= : any extra command-line startup arguments for xcp-rddd
XCP_RRDD_OPTIONS=
1 change: 1 addition & 0 deletions scripts/xcp-rrdd-tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d /dev/shm/metrics 0775 root rrdmetrics -
15 changes: 15 additions & 0 deletions scripts/xcp-rrdd-xenpm.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=XCP RRD daemon xenpm plugin
After=xcp-rrdd.service
Requires=xcp-rrdd.service

[Service]
ExecStart=/opt/xensource/libexec/xcp-rrdd-plugins/xcp-rrdd-xenpm
StandardError=null
# restart but fail if more than 5 failures in 30s
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=30s

[Install]
WantedBy=multi-user.target
21 changes: 21 additions & 0 deletions scripts/xcp-rrdd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=XCP RRD daemon
After=forkexecd.service xenstored.service message-switch.service syslog.target
Wants=forkexecd.service xenstored.service message-switch.service syslog.target

[Service]
Type=notify
Environment="LD_PRELOAD=/usr/lib64/libjemalloc.so.2"
Environment="MALLOC_CONF=narenas:1,tcache:false"
Environment=OCAMLRUNPARAM=b
EnvironmentFile=-/etc/sysconfig/xcp-rrdd
ExecStart=/usr/sbin/xcp-rrdd $XCP_RRDD_OPTIONS
SuccessExitStatus=0
# StandardError=null
# restart but fail if more than 5 failures in 30s
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=30s

[Install]
WantedBy=multi-user.target

0 comments on commit aa631b9

Please sign in to comment.