EC21-E: how to stop "ql_start_ntpd"?

Hi,

I would like to use NTP in EC21-E (openCPU version EC21EFAR06A05M4G_OCPU_20.001.20.001) and I use “ql_start_ntpd” function reported in “ql_ntp.h” header.
Since this function accepts a parameter of interval between request, I wonder how I can stop the process?

I would like to start NTP daemon but just to execute it upon request (not working always in background).

Thanks

Hi there,

You could take following code as a reference to start/stop this daemon via start-stop-daemon as you wish.

#!/bin/sh

set -e

case "$1" in
  start)
        echo -n "Starting NTPD Services: "
        start-stop-daemon -S -b -a mcm_ril_service
        echo "done"
        ;;
  stop)
        echo -n "Stopping MCM RIL Services: "
        start-stop-daemon -K -n mcm_ril_service
        echo "done"
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage start_mcm_ril_srv_le { start | stop | restart}" >&2
        exit 1
        ;;
esac

exit 0

If this is what you want, please choose this as a solution and give me a like. :star_struck:

Br,
Zach

1 Like

Dear Zach,

Thank you for you reference code. That could be a good solution. But now the question is:
how invoke this script from my QuecOpen C application? Via “system” call?

Thanks and regards

Hi Davide,

Yes, I think system would be a choice. :grinning:

Br,
Zach

1 Like

Very good Zach.

Thanks again for confirmation.

Regards