diff --git a/argos/argos_install.sh b/argos/argos_install.sh index 8d4a3c8..74856c5 100755 --- a/argos/argos_install.sh +++ b/argos/argos_install.sh @@ -84,6 +84,7 @@ function do_install { cp argos/argos.service /lib/systemd/system/argos.service cp argos/argos_lookup.service /lib/systemd/system/argos_lookup.service cp argos/service_lookup.py /data/argos/service_lookup.py + cp argos/argos_lookup.timer /lib/systemd/system/argos_lookup.timer chmod +x /data/argos/service_lookup.py systemctl daemon-reload @@ -91,8 +92,7 @@ function do_install { service argos_lookup start sleep 40 service argos start - systemctl enable argos.service - systemctl enable argos_lookup.service + systemctl enable argos_lookup.timer systemctl daemon-reload echo "Installation Successful" } @@ -105,6 +105,7 @@ function uninstall_only { echo "Removing services files" rm /lib/systemd/system/argos.service rm /lib/systemd/system/argos_lookup.service + rm /lib/systemd/system/argos_lookup.timer rm -rf /data/immudb rm /usr/bin/ffmpeg rm -rf /data/argos diff --git a/argos/argos_lookup.timer b/argos/argos_lookup.timer new file mode 100755 index 0000000..2c9fab8 --- /dev/null +++ b/argos/argos_lookup.timer @@ -0,0 +1,8 @@ +[Unit] +Description="Run script after 3 minutes of boot" + +[Timer] +OnBootSec=3min + +[Install] +WantedBy=timers.target diff --git a/argos/package.json b/argos/package.json index 735d3b4..bbf9006 100644 --- a/argos/package.json +++ b/argos/package.json @@ -40,6 +40,7 @@ "utils/parameters.sh", "argos/argos.service", "argos/service_lookup.py", - "argos/argos_lookup.service" + "argos/argos_lookup.service", + "argos/argos_lookup.timer" ] - } \ No newline at end of file + } diff --git a/argos/service_lookup.py b/argos/service_lookup.py index 208cd35..bd62821 100644 --- a/argos/service_lookup.py +++ b/argos/service_lookup.py @@ -70,7 +70,7 @@ def wipe_hosts(hostname): def restart_service(): process = subprocess.Popen( - ['service', 'minio', 'restart'], + ['service', 'argos', 'restart'], stdout=subprocess.PIPE, stderr=subprocess.PIPE ) @@ -125,4 +125,4 @@ def fetch_parse_avahi(): else: print('No changes') - time.sleep(50) + time.sleep(10)