Skip to content
Snippets Groups Projects
Commit b37ccd03 authored by dpuzyrkov's avatar dpuzyrkov
Browse files

[*] cellframe-updater: 10minutes check + proper resintall of node + proper...

[*] cellframe-updater: 10minutes check + proper resintall of node + proper start + kill node by pid if exists.
parent a8aabaff
No related branches found
No related tags found
No related merge requests found
[Timer]
OnCalendar=0/2:00:00
OnCalendar=*:1/10
Persistent=true
unit=cellframe-updater
\ No newline at end of file
Unit=cellframe-updater.service
\ No newline at end of file
......@@ -43,5 +43,9 @@ wget $STORAGE_URL/$PACKAGE_NAME -O /tmp/cfupd/$PACKAGE_NAME
echo "wgot"
service cellframe-node stop
#for shure, "service stop" not olways stops the node...
kill -9 `cat /opt/cellframe-node/var/run/cellframe-node.pid` || true
dpkg -i /tmp/cfupd/$PACKAGE_NAME
service cellframe-node restart
\ No newline at end of file
......@@ -261,22 +261,24 @@ else
fi
fi
#updater service
if [ -f "$DAP_PREFIX/share/update.sh" ]; then
if [ -e /etc/systemd/system/cellframe-updater.service ]; then
echo "[*] Restarting cellframe-updater service"
systemctl --system stop cellframe-updater >> /dev/null|| true
echo "[*] Stopped cellframe-updater"
systemctl daemon-reload || true
systemctl --system start cellframe-updater || true
echo "[*] Started cellframe-diagtool"
else
echo "[!] Installing cellframe-updater as systemd service"
ln -sf $DAP_PREFIX/share/cellframe-updater.service /etc/systemd/system/cellframe-updater.service || true
ln -sf $DAP_PREFIX/share/cellframe-updater.timer /etc/systemd/system/cellframe-updater.timer || true
systemctl --system enable $DAP_PREFIX/share/cellframe-updater.service || true
systemctl start cellframe-updater.timer || true
fi
fi
systemctl daemon-reload
echo "[!] Installing cellframe-updater as systemd service"
ln -sf $DAP_PREFIX/share/cellframe-updater.service /etc/systemd/system/cellframe-updater.service || true
ln -sf $DAP_PREFIX/share/cellframe-updater.timer /etc/systemd/system/cellframe-updater.timer || true
systemctl --system enable $DAP_PREFIX/share/cellframe-updater.service || true
systemctl start cellframe-updater.timer || true
systemctl start cellframe-updater.service || true
echo "[*] Restarting cellframe-updater service"
systemctl --system stop cellframe-updater >> /dev/null|| true
echo "[*] Stopped cellframe-updater"
systemctl daemon-reload || true
systemctl --system start cellframe-updater || true
echo "[*] Started cellframe-updater"
chmod 0666 $DAP_CFG
chmod 0666 $DAP_CFG_TPL
chmod 0774 $DAP_PREFIX/bin/* || true
......
VERSION_MAJOR=5
VERSION_MINOR=2
VERSION_PATCH=187
VERSION_PATCH=190
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment