Home
[RDK Central Wiki]
CMF
[Code Releases]
We would like to restart the crond service after installing our application and we find that it does not run on the RPi reference platform. Upon inspecting the service_crond.sh script, we found that the file /nvram/ETHWAN_ENABLE is expected, but not created on the RPi. However, sysevent get ethwan-initialized returns 1 indicating that the service has started correctly (also, it is our understanding that /usr/ccsp/gw_prov_ethwan is the trigger for the startup sequence).
Powered by a free Atlassian Confluence Open Source Project License granted to RDKCentral. Evaluate Confluence today.
5 Comments
Unknown User (srinivas.k)
HI Nitin Patet,
Currently the RPI supports ETHWAN. The flag ETHWAN_ENABLE is created in RPI when we try to switch between the different wan modes, like docsis to ethwan or gpon to ethwan etc . Since RPI doesnt have dual mode support it won't switch between the modes and the flag won't be created.
If the flag is the blocker for your application, then let us know your requirement, we will try to enable the flag in /nvram
Thanks and Regards
Srinivas
Unknown User (nitin.patet)
Hi Srinivas,
We use cronjob to schedule some actions from our application and need the crond service to be running for that. Shouldn't crond be independent of ETHWAN_ENABLE? Today, the crond service simply doesn't run on the RPi!
Here's an excerpt from service_crond.sh:
Also, we've noticed that the crond service cannot execute "opkg upgrade" if the following sequence of steps is executed:
Oddly, we see that the "opkg upgrade" works if the crond is restarted using "killall crond && crond -l 9" instead. Please advice on how we can fix!
Unknown User (srinivas.k)
HI Nithin Patet,
Add the below code changes in gw_prov_ethwan_sm.c to enable the Ethan flag in /nvram partition.
static int GWP_act_ProvEntry_callback()
{
GWPROVETHWANLOG( "Entering into %s\n",__FUNCTION__); system("mkdir -p /nvram");
#if defined(_PLATFORM_TURRIS_)
system("mount /dev/mmcblk0p6 /nvram");
#endif
system("rm -f /nvram/dnsmasq.leases");
system("syslogd -f /etc/syslog.conf"); //copy files that are needed by CCSP modules
system("cp /usr/ccsp/ccsp_msg.cfg /tmp");
system("touch /tmp/cp_subsys_ert"); /* Below link is created because crond is expecting /crontabs/ dir instead of /var/spool/cron/crontabs */
system("ln -s /var/spool/cron/crontabs /");
/* directory /var/run/firewall because crond is expecting this dir to execute time specific blocking of firewall*/
system("mkdir -p /var/run/firewall"); system("/etc/utopia/utopia_init.sh");
#if defined(_PLATFORM_RASPBERRYPI_)
system("touch /nvram/ETHWAN_ENABLE");
#endif
Please find below procedure to restart the crond.
before restarting:
root@RaspberryPi-Gateway:~# ps | grep crond
6004 root 0:00 crond -l 9
19613 root 0:00 grep crond
After restarting:
root@RaspberryPi-Gateway:~#
root@RaspberryPi-Gateway:~# sysevent set crond-restart 1
root@RaspberryPi-Gateway:~# ps | grep crond
19895 root 0:00 crond -l 9
19898 root 0:00 grep crond
Thanks and Regards
Srinivas
Unknown User (nitin.patet)
Hi Srinivas,
Thanks for the suggestion. Will you be submitting this to the RDK-B codebase since it affects the startup of cronjobs on the RPi reference platform?
Unknown User (srinivas.k)
Hi Nitin Patet,
Please find the below code changes for enabling the ETHWAN_ENABLE flag in rpi builds.
https://code.rdkcentral.com/r/c/components/generic/rdk-oe/meta-cmf-raspberrypi/+/39328
Thanks and Regards
Srinivas