Cron 0.1.8 wont run reboot command



  • the new cron package on the latest pfsense doesnt seems to reboot the box using reboot command, the older version works fine but it seems the upate a month agao caused this not to work any longer


  • Rebel Alliance Developer Netgate

    The change to cron last month would not have had any impact on that. It was only a change to how the cron process itself was stopped and started.

    Make sure you're running the correct command with the full path, and/or try calling the reboot php script using:
    /usr/local/bin/php -f /etc/rc.reboot



  • i tried the command u gave with the full path but still nothing happens, earlier using reboot command only also used to work, is there any way to debug this?



  • would it be possible to get the old cron package till the issue is sorted out?



  • can you check if your cron settings are present on crontab file?


  • Rebel Alliance Developer Netgate

    @xbipin:

    would it be possible to get the old cron package till the issue is sorted out?

    The binaries are the same – they're on pfSense, not in the cron package. All the cron package does is manipulate config.xml, and stop/start the cron service as needed.

    Unless the cron service is not running, it's doubtful that the package is doing anything different from the last version to this one.



  • i agree the package hasnt changed much at all but since the upgrade to the new cron on one of my boxes, it fails to run the command, the serice is running fine and i checked that only initially but for some reason the command isnt issued at all.

    can u give me the location of the crontab file so i can check that



  • I'll throw a twist into this.  I have two boxes now running 2.1 with all the same packages running.  The one running at my neighbor's (while his son is building his own) was a 2.0.3 upgrade to 2.1 and the weekly reboot still runs fine.  Mine is a 2.1 fresh build and I'm seeing the same issue as xbipin.  Reboot just never happens.  Jim, I just changed to the path you recommended and set the job to daily.  I'll let you know how it works.

    Rick


  • Rebel Alliance Developer Netgate

    For giggles, I added a cron command for "/etc/rc.reboot" to my VM and set it to reboot at 10am. It just rebooted, and it's on the most current version of the cron package.



  • i tried a different command and now it works, summary as follows:

    command = reboot (works in old cron but not new)

    command = /etc/rc.reboot (works in both crons)

    command = /usr/local/bin/php -f /etc/rc.reboot (doesnt work in both crons)

    when it rebooted i noticed this error in serial console for new cron

    Starting CRON... done.
     Starting package Cron...[: 0: unexpected operator
    done.
    Bootup complete[/code]
    

  • Rebel Alliance Developer Netgate

    Are you sure you have the most current version of the cron package?

    : ps uxawww | grep '[c]ron -s'
    root    29903  0.0  0.3  7928  1604  ??  Is   11:14AM   0:00.00 /usr/sbin/cron -s
    : /usr/local/etc/rc.d/cron.sh stop
    : ps uxawww | grep '[c]ron -s'
    : /usr/local/etc/rc.d/cron.sh start
    : ps uxawww | grep '[c]ron -s'
    root    33179  0.0  0.3  7928  1604  ??  Ss   11:14AM   0:00.00 /usr/sbin/cron -s
    

    No errors here.

    and "reboot" is a bad idea no matter what. Always use /etc/rc.reboot or you risk losing data.



  • i reinstalled the cron package, it was the latest one though, and the error disappeared, use the below works for me so will stick with it

    command = /etc/rc.reboot (works in both crons)