Starting Freetz takes 5 minutes

M66B

Mitglied
Mitglied seit
17 Feb 2010
Beiträge
225
Punkte für Reaktionen
0
Punkte
0
Since a few days (after a firmware update; latest trunk version) starting Freetz (without firmware update) takes 5 minutes.

First logging Fritz!Box (standard interface):

26.04.10 08:06:18 DSL is available (DSL synchronization exists with 11866/1007 Kbit/s).

Going from the standard webif to Freetz using the link gives:

Error[webcfg]: not configured

First logging of Freetz:

Apr 26 08:04:46 fritz daemon.info init: starting pid 9407, tty '': '/bin/sh -c /var/post_install'
Apr 26 08:11:57 fritz syslog.info syslogd started: BusyBox v1.16.1


It looks like the firmware is being updated, but actually there was no new firmware uploaded. How can I solve this?
 
first you shoul habe a look in your debug.cfg, or delete the content at all. "echo > /var/flash/debug.cfg". Most of the "long-start-issues" are solved in this way.
 
first you shoul habe a look in your debug.cfg, or delete the content at all. "echo > /var/flash/debug.cfg". Most of the "long-start-issues" are solved in this way.

Thanks, my debug.cfg contained the code below, however dtmfbox was not installed anymore (and the directory had been removed).

########## -= dtmfbox settings - DO NOT EDIT - S =- ##########
(
# USB-Mount (300 sec)
let cnt=0;
while [ ! -f "/var/media/ftp/uFlash/dtmfbox/boot.sh" ]; do
if [ $cnt -eq 30 ]; then break; fi
let cnt=cnt+1;
sleep 10
done;
)
sleep 30; sh "/var/media/ftp/uFlash/dtmfbox/boot.sh"
########## -= dtmfbox settings - DO NOT EDIT - E =- ##########

 
The "installation routine" of dtmfbox adds this code to debug.cfg in some cases. This is not removed by simple unchecking dtmfbox in menuconfig.
Maybe we should check for this code anywhere if dtmfbox is not present?
 
Good plan!

Actually I tried a lot of packages and one day my configuration flash was full. After some searching I discovered that some deselected packages leave config files in /var/tmp/flash.

I added instruction about how to solve this situation in the wiki here.
 
The configs are kept in /var/tmp/flash, even if the packages are deselected. Thes behaviour is definitly wanted. ;) But the debug.cfg-issue of the dtmfbox-cfg is something we should change.
 
I would add an entry to the FAQ, but not try to detect it at runtime.
The code in debug.cfg does exactily what it is supposed to do, it is just not longer intended to be there.

We could add a warning somewhere to the status page "nonempty debug.cfg detected, maybe you should use /tmp/flash/rc.custom?"
 
The configs are kept in /var/tmp/flash, even if the packages are deselected. Thes behaviour is definitly wanted. ;)
I agree, but it should be made clear that this is happening somehow (FAQ?).

BTW, another thing I missed during my quest to solve this problem was the time for the log entries in mod*.log.

Another thing I noticed is that swap is mounted rather late, almost after all services were started (inluding the memort hungry ones).
 
Maybe that the late swap start is useful, because the storage must be mounted.
 
Maybe that the late swap start is useful, because the storage must be mounted.
I agree with that, but most other services that depend on external storage are starting earlier than swap. See logging below: syslogd, nfsd, rrdstats, vnstats and XMail all depend on external storage and seem to start earlier that swap.

rc.mod version freetz-devel-4784M
Starting crond...done.
telnetd is disabled.
Starting Freetz webinterface...done.
Starting syslogd...done.
done.
Starting nfsd...done.
dnsmasq already started.
Starting dropbear SSH server...done.
Starting rrdstats...done.
Starting vnstat...done.
Starting aiccu...done.
Setting up SSH authorized_keys for root...initialized.
Set IPv6 address: xxxx : xxxx : xxxx::/64 done.
Enable IPv6 forwarding...done.
Starting radvd...done.
Starting transmission daemon... without password protection.. done.
Starting XMail SMTP/POP3 server ...Starting swap...done.
done.
 
But none of this services needs usb-access essentially at starttime. only swap mounts a file/a partition at starttime.
 
In my case all these services are configured to use external storage. Syslogd, rrdstats and vnstat are writing to USB storage to let the logging/data survive reboots, nfsd publishes USB storage to my local network and XMail needs USB storage to store e-mail.

But back to the case: if starting all services need more memory then available without swap, starting would fail (this is fortunately not the case). In other words: swap could be essential to start services that need a lot of memory during startup.
 
Perhaps you can try this change:
Code:
--- root/etc/init.d/rc.mod	(revision 4795)
+++ root/etc/init.d/rc.mod	(working copy)
@@ -21,6 +21,7 @@
 	/etc/init.d/rc.crond
 	/etc/init.d/rc.telnetd
 	/etc/init.d/rc.webcfg
+	/etc/init.d/rc.swap
 
 	# Static Packages
 	EXTERNAL_SERVICES="$(cat /etc/external.pkg 2>/dev/null)"
@@ -54,8 +55,6 @@
 
 	[ -r /tmp/flash/rc.custom ] && mv /tmp/flash/rc.custom /tmp/flash/mod/rc.custom
 	[ -r /tmp/flash/mod/rc.custom ] && . /tmp/flash/mod/rc.custom
-
-	/etc/init.d/rc.swap
 }
 
 modreg_file() {
Regards
Oliver
 
Thanks, Oliver. Everyday I understand more about the architecture of Freetz.

Maybe there should be a wiki page that lists relevant files like this and there meaning (or is there already one?). I try to document in de wiki what I discover.

I will try your patch tonight, but one question: are the disks mounted at that point?
 
I will try your patch tonight, but one question: are the disks mounted at that point?

Maybe

EDIT: If you use the "trunk" you could try the new service-start-feature of external. Type "swap" in the own Services field and it will be started when the other partition is mounted
 
Zuletzt bearbeitet:
Works perfectly, so maybe this patch should be applied to trunk.
Code:
rc.mod version freetz-devel-4797M
Starting crond...done.
telnetd is disabled.
Starting Freetz webinterface...done.
Starting swap...done.
Starting syslogd...done.
done.
Starting nfsd...done.
dnsmasq already started.
Starting dropbear SSH server...done.
Testing /bin/busybox...
etc.
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.