Ahoj,
musel jsem udělat factory reset a objevil následující chyby:
- Nefunkční updater - chybová hláška “More than one candidate with a virtual package ip”
- Po použití image z kroku jedna, nelze ve forisu v sekci Data Collection ověřit email.
Nestálo by za to, někde viditelně třeba v how-to, shrnout, jak provést factory-reset (teď nemyslím čekat na rozsvícení 3 LEDek)? Předpokládám, že body 1 a 2 nastanou každému díky změně infrastruktury na servrech.
Ta dvojka nastava v pripade, kdy neni vygenerovany registracni kod. Ten se generuje jednou za hodinu, tak to, prosim, zkuste napr. po par hodinach jeste jednou. V pripade zprovozneneho pristupu pres ssh to lze vynutit prikazem. Viz Selhání registrace sběru dat
1 Like
Diky za nasmerovani. Nicmene ani po trech dnech se kod nevygeneroval. Na prvni pohled nevidim co je spatne.
- cron deamon bezi
- cron script
/etc/cron.d/server-uplink.cron
existuje a ma spravna prava
- odkazovany skript
/usr/share/server-uplink/registration_code.sh
existuje a ma spravna prava
A vysledny soubor /usr/share/server-uplink/registration_code
je prazdny, i kdyz by nemel.
Pokud vykonam skript rucne radek po radku (bez zapsani do souboru), tak dostanu vygenerovany kod.
Nevidim, kde nastava chyba, necham to zatim tak, abychom to mohli odchytit a pripadne opravit.
Pokud mate nejake napady, tak sem s nima.
Diky.
root@turris:~# ls -l /etc/cron.d/server-uplink.cron
-rw-r--r-- 1 root root 136 Jan 15 12:40 /etc/cron.d/server-uplink.cron
root@turris:~# cat /etc/cron.d/server-uplink.cron
MAILTO=""
*/60 * * * * root /usr/share/server-uplink/registration_code.sh
*/60 * * * * root /usr/share/server-uplink/contract_valid.sh
root@turris:~# ps | grep cron
2394 root 760 S /usr/sbin/cron -n
29997 root 1108 S grep cron
root@turris:~# ls -l /usr/share/server-uplink/registration_code.sh
-rwxr-xr-x 1 root root 1208 Jan 15 12:40 /usr/share/server-uplink/registration_code.sh
root@turris:~# cat /usr/share/server-uplink/registration_code.sh
#!/bin/sh
#
# Copyright (C) 2017 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
set -e
TIMEOUT=120
CA_FILE=/etc/ssl/www_turris_cz_ca.pem
CHALLENGE_URL=https://api.turris.cz/challenge.cgi
OUTPUT_FILE=/usr/share/server-uplink/registration_code
CODE=$(curl -s -k -m $TIMEOUT "$CHALLENGE_URL" | atsha204cmd challenge-response | head -c 16)
# test whether the code is the same
if [ -f "$OUTPUT_FILE" ] ; then
if [ "$CODE" == "$(cat "$OUTPUT_FILE")" ] ; then
exit 0
fi
fi
echo -n "$CODE" > "$OUTPUT_FILE"
root@turris:~# cat /usr/share/server-uplink/registration_code
root@turris:~#
Zkuste parkrat skript rucne spustit, a vzdy zkontrolujte, jestli se ten kod do souboru registration-code
neulozi.
Pokud to nepomuze, poselete, prosim, vystup z prikazu:
sh -x /usr/share/server-uplink/registration_code.sh
(Nezverejnujte ale pripadny registracni kod.)
Mame pripravenou novou verzi tohoto skriptu, kde je zajisteno, ze se kod neprepise v pripade, ze od serveru nedojde odpoved (coz se pravdepodobne v tomto pripade stalo).
Pustil jsem ho nekolikrat a funguje jak ma.
Jeste uvidime co se stane, az se znova pusti cron.
Diky za pomoc.
1 Like
Jasne, v pohode.
Kdyz se uz jednou povede k odesilani dat zaregistrovat, tak by to uz melo slapat nezavisle na tomto souboru.
Kazdopadne v nove verzi (3.9.4) bude tento problem odstranen.
Presne jak jsem si myslel, pokud se pusti pres cron, tak to nikdy kod nevygeneruje.
root@turris:~# ls -l /usr/share/server-uplink/registration_code
-rw-r–r-- 1 root root 0 Jan 23 17:02 /usr/share/server-uplink/registration_code
Kazdopadne, pokud uz mate jiny skript tak to neni treba resit.