ipkg installed ntpdate not working from init script

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
spang34
DD-WRT Novice


Joined: 10 May 2025
Posts: 2

PostPosted: Sat May 10, 2025 6:06    Post subject: ipkg installed ntpdate not working from init script Reply with quote
I have a script to start an ntp daemon in /jffs/etc/config/9ntpstart.startup.

When I run the script from the shell this works fine. However, when run from the system startup I this error is produced.

Code:

+ /opt/bin/ntpdate -t1 -p3 192.168.2.1
<jemalloc>: Cannot allocate memory for MADV_DONTNEED check
Segmentation fault
+ sleep 3


The script is simple:
Code:

#!/bin/sh

exec > /tmp/debug_ntp.txt 2>&1
set -x


while ! /opt/bin/ntpdate -t1 -p3 192.168.2.1 ; do
    sleep 3
done
/opt/bin/ntpd -c /opt/etc/ntp/ntp.conf


What is the difference in the enviroment from the startup scripts and the shell?
Sponsor
spang34
DD-WRT Novice


Joined: 10 May 2025
Posts: 2

PostPosted: Sat May 10, 2025 7:30    Post subject: Reply with quote
LD_PRELOAD= /opt/bin/ntpd -c /opt/etc/ntp/ntp.conf
fixes it.

seems ntp doesn't like /usr/lib/libjemalloc.so
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum