feature:TSG-7716:新增自检相关的one-shot脚本和loop的service
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
3
scripts/tsg-diagnose-oneshot
Normal file
3
scripts/tsg-diagnose-oneshot
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash -xe
|
||||
systemctl start tsg-diagnose
|
||||
docker exec -it dign-client /bin/sh -c "python bin/client.py"
|
||||
3
scripts/tsg-diagnose-periodical
Normal file
3
scripts/tsg-diagnose-periodical
Normal 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"
|
||||
12
service/tsg-diagnose-periodical.service
Normal file
12
service/tsg-diagnose-periodical.service
Normal 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
|
||||
Reference in New Issue
Block a user