From 6389a9cd880337a491b1b76eae29ed20addce57c Mon Sep 17 00:00:00 2001 From: Anol Paisal Date: Wed, 21 Aug 2024 15:07:22 +0700 Subject: [PATCH 1/2] Add example systemd service --- services/ground/csp_client.service | 12 ++++++++++++ services/ground/csp_server.service | 12 ++++++++++++ services/ground/zmqproxy.service | 11 +++++++++++ services/space/csp_client.service | 12 ++++++++++++ services/space/csp_server.service | 12 ++++++++++++ services/space/zmqproxy.service | 10 ++++++++++ 6 files changed, 69 insertions(+) create mode 100755 services/ground/csp_client.service create mode 100755 services/ground/csp_server.service create mode 100755 services/ground/zmqproxy.service create mode 100755 services/space/csp_client.service create mode 100755 services/space/csp_server.service create mode 100755 services/space/zmqproxy.service diff --git a/services/ground/csp_client.service b/services/ground/csp_client.service new file mode 100755 index 000000000..5f28ca005 --- /dev/null +++ b/services/ground/csp_client.service @@ -0,0 +1,12 @@ +[Unit] +Description=CSP client service +Wants=network.target +After=zmqproxy.service + +[Service] +Type=simple +PIDFile=/run/csp_client.pid +ExecStart=/usr/local/bin/csp_client -z localhost -f 2 -a 4 -C 5 + +[Install] +WantedBy=multi-user.target diff --git a/services/ground/csp_server.service b/services/ground/csp_server.service new file mode 100755 index 000000000..e90076da1 --- /dev/null +++ b/services/ground/csp_server.service @@ -0,0 +1,12 @@ +[Unit] +Description=CSP server service +Wants=network.target +After=zmqproxy.service + +[Service] +Type=simple +PIDFile=/run/csp_server.pid +ExecStart=/usr/local/bin/csp_server -z localhost -f 2 -a 2 + +[Install] +WantedBy=multi-user.target diff --git a/services/ground/zmqproxy.service b/services/ground/zmqproxy.service new file mode 100755 index 000000000..828ae5f40 --- /dev/null +++ b/services/ground/zmqproxy.service @@ -0,0 +1,11 @@ +[Unit] +Description=CSP ZMQ service +Wants=network.target + +[Service] +Type=simple +PIDFile=/run/zmqproxy.pid +ExecStart=/usr/local/bin/zmqproxy + +[Install] +WantedBy=multi-user.target diff --git a/services/space/csp_client.service b/services/space/csp_client.service new file mode 100755 index 000000000..a7714b2f6 --- /dev/null +++ b/services/space/csp_client.service @@ -0,0 +1,12 @@ +[Unit] +Description=CSP client service +Wants=network.target +After=zmqproxy.service + +[Service] +Type=simple +PIDFile=/run/csp_client.pid +ExecStart=/usr/local/bin/csp_client -z 10.1.1.138 -f 1 -a 3 -C 2 + +[Install] +WantedBy=multi-user.target diff --git a/services/space/csp_server.service b/services/space/csp_server.service new file mode 100755 index 000000000..1dd7f1d5b --- /dev/null +++ b/services/space/csp_server.service @@ -0,0 +1,12 @@ +[Unit] +Description=CSP server service +Wants=network.target +After=zmqproxy.service + +[Service] +Type=simple +PIDFile=/run/csp_server.pid +ExecStart=/usr/local/bin/csp_server -z 10.1.1.138 -f 1 -a 5 + +[Install] +WantedBy=multi-user.target diff --git a/services/space/zmqproxy.service b/services/space/zmqproxy.service new file mode 100755 index 000000000..94cf32b3e --- /dev/null +++ b/services/space/zmqproxy.service @@ -0,0 +1,10 @@ +[Unit] +Wants=network.target + +[Service] +Type=simple +PIDFile=/run/zmqproxy.pid +ExecStart=/usr/local/bin/zmqproxy + +[Install] +WantedBy=multi-user.target From fb88bbe6bb181bdfa6e9cfe226b4c390e9a0e0f5 Mon Sep 17 00:00:00 2001 From: Anol Paisal Date: Fri, 23 Aug 2024 21:36:14 +0700 Subject: [PATCH 2/2] Update space base systemd service. --- services/space/csp_client.service | 2 ++ services/space/csp_server.service | 2 ++ services/space/zmqproxy.service | 2 ++ 3 files changed, 6 insertions(+) diff --git a/services/space/csp_client.service b/services/space/csp_client.service index a7714b2f6..9f667755c 100755 --- a/services/space/csp_client.service +++ b/services/space/csp_client.service @@ -4,9 +4,11 @@ Wants=network.target After=zmqproxy.service [Service] +User=pi Type=simple PIDFile=/run/csp_client.pid ExecStart=/usr/local/bin/csp_client -z 10.1.1.138 -f 1 -a 3 -C 2 +WorkingDirectory=/home/pi/Projects/libcsp/build/examples/ [Install] WantedBy=multi-user.target diff --git a/services/space/csp_server.service b/services/space/csp_server.service index 1dd7f1d5b..6193303d2 100755 --- a/services/space/csp_server.service +++ b/services/space/csp_server.service @@ -4,9 +4,11 @@ Wants=network.target After=zmqproxy.service [Service] +User=pi Type=simple PIDFile=/run/csp_server.pid ExecStart=/usr/local/bin/csp_server -z 10.1.1.138 -f 1 -a 5 +WorkingDirectory=/home/pi/Projects/libcsp/build/examples/ [Install] WantedBy=multi-user.target diff --git a/services/space/zmqproxy.service b/services/space/zmqproxy.service index 94cf32b3e..cc354c268 100755 --- a/services/space/zmqproxy.service +++ b/services/space/zmqproxy.service @@ -2,9 +2,11 @@ Wants=network.target [Service] +User=pi Type=simple PIDFile=/run/zmqproxy.pid ExecStart=/usr/local/bin/zmqproxy +WorkingDirectory=/home/pi/Projects/licsp/build/examples/ [Install] WantedBy=multi-user.target