OpenWrt Forum Archive

Topic: Bug report + small fixes for lastest experimental sources from CVS

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello!

I've successfully installed experimental OpenWRT on two WRT54Gs here.
Kudos to all the developers --- this thing rocks!

Now some bugs and proposed fixes:

(1)
I use PPPoE to connect to my ISP.
When pppd creates /tmp/resolv.conf, it does so with permissions 600,
and this is bad, because dnsmasq drops privileges to nobody and fails to read this file.

I put
===cut===
touch /tmp/resolv.conf
chmod 644 /tmp/resolv.conf
===cut===

in my /etc/init.d/S10boot script to fix this.

(2)
NTP client has to be started after PPPoE starts.
So I had to make PPPoE start earlier in the boot up:
mv S50pppoe S45pppoe

(3)
A rewritten version of S50ntpclient,
that uses the ntp_server NVRAM variables:
===cut===
#!/bin/sh

[ "$(nvram get ntp_enable)" = "1" ] || exit 0

NTP_SERVER=$(nvram get ntp_server)
NTP_SERVER=${NTP_SERVER:-pool.ntp.org}

/usr/sbin/ntpclient -s -h $NTP_SERVER
===cut===

(4)
For some reason, I was unable to use passwd
to change my password; it complained
about not being able to update or something.
I had to copy an old /etc/passwd
to use ssh.  Anybody seen this problem?

Thanks,
Steve

I've seen the passwd update problem immediately after updating -- It goes away after
the first reboot.  I've always attributed it to the jffs2 firstboot stuff.
--
Dale

Talking about permissions: /tmp comes chmod'd 755, which makes it impossible for non-root apps to create temp files (I had strange problems after I coerced Asterisk to run as non-privileged user). I'd recommend to change the permissions to 777.

Enzo

strange.

jffs2 image from today cvs:
drwxrwxrwt    4 root     root          140 Jan  1 00:01 tmp

steve.cheng wrote:

Hello!

(2)
NTP client has to be started after PPPoE starts.
So I had to make PPPoE start earlier in the boot up:
mv S50pppoe S45pppoe

I would remove S45ntpclient and issue ntpclient just after the ppp link gets up.
Like this you don't need to create a cronjob for regular updating either.
(I am assuming that you are redialling regularly)


To do this create a file /etc/ppp/ip-up with this content:

#!/bin/sh
# This is /etc/ppp/ip-up
# please do: chmod a+x /etc/ppp/ip-up

PATH=/usr/sbin:/sbin:/usr/bin:/bin
export PATH

# These variables are for the use of the scripts
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM

# update hostname
# ez-ipupdate -s servername_xyz -S dyndns -u zoo:zoodyn -h hostname_xyz -a $PPP_LOCAL

# Set time
ntpclient -c 1 -s -h pool.ntp.org

The discussion might have continued from here.