From cc79faf13f51b614ff57c13b8e07cf0a73c96ced Mon Sep 17 00:00:00 2001 From: Joel Klimont Date: Tue, 4 Oct 2022 20:28:58 +0200 Subject: [PATCH] started working on compsrv package --- server_v2/CMakeLists.txt | 0 server_v2/build_deb.sh | 17 +++++++++++++++++ server_v2/compsrv.service | 11 +++++++++++ server_v2/postinstall.sh | 3 +++ 4 files changed, 31 insertions(+) mode change 100644 => 100755 server_v2/CMakeLists.txt create mode 100755 server_v2/build_deb.sh create mode 100755 server_v2/compsrv.service create mode 100755 server_v2/postinstall.sh diff --git a/server_v2/CMakeLists.txt b/server_v2/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/server_v2/build_deb.sh b/server_v2/build_deb.sh new file mode 100755 index 0000000..3088c81 --- /dev/null +++ b/server_v2/build_deb.sh @@ -0,0 +1,17 @@ +fpm \ + -s dir -t deb \ + -m '"Joel Klimont" ' \ + --license 'proprietary' \ + --description 'Library for robot used in the competition' \ + --deb-priority "optional" \ + --deb-systemd "compsrv.service" \ + --after-install postinstall.sh \ + --after-upgrade postinstall.sh \ + -p compsrv-1.0.0-0-any.deb \ + --name compsrv \ + --version 1.0.0-0 \ + --architecture all \ + ./build/compsrv=/usr/bin/compsrv + +# dpkg-deb -xv compsrv-1.0.0-0-any.deb test_bin +# sudo rm -rf test_bin/usr test_bin/lib diff --git a/server_v2/compsrv.service b/server_v2/compsrv.service new file mode 100755 index 0000000..94548d7 --- /dev/null +++ b/server_v2/compsrv.service @@ -0,0 +1,11 @@ +[Unit] +Description=Complib backend control server +[Service] +ExecStart=/usr/bin/compsrv +Environment="debug=False" +Restart=always +RestartSec=5 +Type=notify +[Install] +Alias=compsrv +WantedBy=default.target \ No newline at end of file diff --git a/server_v2/postinstall.sh b/server_v2/postinstall.sh new file mode 100755 index 0000000..ecbb41a --- /dev/null +++ b/server_v2/postinstall.sh @@ -0,0 +1,3 @@ +#!/bin/sh +service compsrv restart +systemctl enable compsrv