OpenWrt Forum Archive

Topic: ipkg post install script to restart a service !!

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

Hi guys, I am trying to restart cron whenever I update base-files package.
So I wrote a script "package/base-files/ipkg/base-files.postinst" :

/etc/init.d/S??cron restart

It gave me error while compiling the firmware

could not find file /etc/init.d/S??cron

So I tried :

IS_FIRMWARE=$(echo $IPKG_INSTROOT | grep build_mipsel)
if [ "$IS_FIRMWARE" = "" ];then
        crontab /etc/crontabs/rootcrons
        $IPKG_INSTROOT/etc/init.d/S??cron restart
        crontab /etc/crontabs/rootcrons
else
        echo "*****************$IPKG_INSTROOT**********************************************"
fi

It worked but is this the right way ?

Plus the command : "crontab /etc/crontabs/rootcrons" is not getting executed. sad

(Last edited by lnxnubie on 17 Jul 2007, 08:29)

Well the post install script worked and I found out the problem with "crontab /etc/crontabs/rootcrons" not working.
/etc/init.d/S60cron deletes all the files in /etc/crontab and copies it from /rom. So my new rootcrons was getting overwritten.

The discussion might have continued from here.