diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0657a45..0757e26 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,6 +59,8 @@ feature_branch_build: TESTING_VERSION_BUILD: 1 extends: .build_rpm script: + - chmod 0755 ./scripts/tsg-diagnose-oneshot + - chmod 0755 ./scripts/tsg-diagnose-periodical - ./ci/travis.sh dependencies: - images_build diff --git a/cmake/Package.cmake b/cmake/Package.cmake index 11963a0..170b37d 100644 --- a/cmake/Package.cmake +++ b/cmake/Package.cmake @@ -24,8 +24,11 @@ set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/cmake/PostunInstall install(FILES compose/docker-compose.yml DESTINATION ./compose) install(FILES images_build/client/dign_client/etc/client.conf DESTINATION ./etc) install(FILES service/tsg-diagnose.service DESTINATION /usr/lib/systemd/system) +install(FILES service/tsg-diagnose-periodical.service DESTINATION /usr/lib/systemd/system) install(FILES service/tsg-diagnose.conf DESTINATION /usr/lib/tmpfiles.d) install(FILES images_build/server_dns/dnsmasq.conf DESTINATION /opt/tsg/tsg-diagnose/etc/) install(DIRECTORY images/ DESTINATION ./images) +install(DIRECTORY scripts/ DESTINATION ./scripts) +install(DIRECTORY scripts/ DESTINATION ./scripts) include(CPack) diff --git a/scripts/tsg-diagnose-oneshot b/scripts/tsg-diagnose-oneshot new file mode 100644 index 0000000..04511a6 --- /dev/null +++ b/scripts/tsg-diagnose-oneshot @@ -0,0 +1,3 @@ +#!/bin/bash -xe +systemctl start tsg-diagnose +docker exec -it dign-client /bin/sh -c "python bin/client.py" \ No newline at end of file diff --git a/scripts/tsg-diagnose-periodical b/scripts/tsg-diagnose-periodical new file mode 100644 index 0000000..b596076 --- /dev/null +++ b/scripts/tsg-diagnose-periodical @@ -0,0 +1,3 @@ +#!/bin/bash -xe +systemctl start tsg-diagnose +docker exec -it dign-client /bin/sh -c "python bin/client.py -l" \ No newline at end of file diff --git a/service/tsg-diagnose-periodical.service b/service/tsg-diagnose-periodical.service new file mode 100644 index 0000000..caa7517 --- /dev/null +++ b/service/tsg-diagnose-periodical.service @@ -0,0 +1,12 @@ +[Unit] +Description=Tsg diagnose periodical +Requires=tsg-diagnose.service +After=tsg-diagnose.service + +[Service] +ExecStart=/usr/bin/docker exec dign-client python bin/client.py -l +ExecStopPost=/bin/sh -c "docker container top dign-client | grep 'python bin/client.py -l' | awk '{print $2}' | xargs kill" +#ExecStopPost=/bin/echo '11111' + +[Install] +WantedBy=multi-user.target