aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2022-05-02 01:11:51 +0200
committerFranciszek Malinka <franciszek.malinka@gmail.com>2022-05-02 01:11:51 +0200
commitd6c192805e54ccdc07f15afae6b5d0c74d7cf7d9 (patch)
tree799d925733374b4d749cce921a9afc5144831943
parentd8b43bd592e368f463914ee4d38047a5ce49a25e (diff)
Added systemd units for this particular daemon
-rw-r--r--systemd-units/mystat-graph.service6
-rw-r--r--systemd-units/mystat-graph.timer12
-rw-r--r--systemd-units/mystatd.service13
3 files changed, 31 insertions, 0 deletions
diff --git a/systemd-units/mystat-graph.service b/systemd-units/mystat-graph.service
new file mode 100644
index 0000000..8c3168f
--- /dev/null
+++ b/systemd-units/mystat-graph.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Periodic processor load graph creation
+
+[Service]
+Type=oneshot
+ExecStart=bash /home/framal/Documents/wmiuwr/semestr-6/kurs-linux/pracownia-7/create-plots.sh
diff --git a/systemd-units/mystat-graph.timer b/systemd-units/mystat-graph.timer
new file mode 100644
index 0000000..cb21184
--- /dev/null
+++ b/systemd-units/mystat-graph.timer
@@ -0,0 +1,12 @@
+[Unit]
+Description=Periodic processor load graph creation
+Requires=mystatd.service
+
+[Timer]
+OnCalendar=*-*-* *:*:00
+Persistent=true
+AccuracySec=5s
+
+[Install]
+WantedBy=timers.target
+
diff --git a/systemd-units/mystatd.service b/systemd-units/mystatd.service
new file mode 100644
index 0000000..c7bef69
--- /dev/null
+++ b/systemd-units/mystatd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Mystat daemon written for learning purposes
+
+[Service]
+Type=forking
+PIDFile=/run/mystat.pid
+ExecStart=/home/framal/Documents/wmiuwr/semestr-6/kurs-linux/pracownia-7/mystat \
+ --interval 5 \
+ --daemon
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=sysinit.target