feature:TSG-7716:新增自检相关的one-shot脚本和loop的service

This commit is contained in:
fumingwei
2021-09-11 14:34:37 +08:00
parent a9f034a06f
commit d4531121a0
5 changed files with 23 additions and 0 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -0,0 +1,3 @@
#!/bin/bash -xe
systemctl start tsg-diagnose
docker exec -it dign-client /bin/sh -c "python bin/client.py"

View File

@@ -0,0 +1,3 @@
#!/bin/bash -xe
systemctl start tsg-diagnose
docker exec -it dign-client /bin/sh -c "python bin/client.py -l"

View File

@@ -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