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