SOLVED Daily wake-up routine not working after update


  • Hi Team,

    I updated to the latest dev branch earlier this week and now our scheduled WoL isn’t working. I can still trigger it manually so I know the WoL packets are not the issue.
    I tried deleting the task and creating a new one but no change.

    Just looked at the /var/log/fog/fogscheduler.log and the latest entry is from the date I updated the system:

    [03-22-21 10:30:55 am] * Task run time: Tue, 23 Mar 2021 06:00:00 -0500
    

    Looks like a service isn’t running, but checking the scheduler it appears fine:

    [Cent-7:root@fog ~]# systemctl status FOGScheduler.service
    ● FOGScheduler.service - FOGScheduler
       Loaded: loaded (/usr/lib/systemd/system/FOGScheduler.service; enabled; vendor preset: disabled)
       Active: active (running) since Fri 2021-03-19 14:31:56 CDT; 5 days ago
     Main PID: 2955 (php)
       Memory: 16.6M
       CGroup: /system.slice/FOGScheduler.service
               ├─2955 php /opt/fog/service/FOGTaskScheduler/FOGTaskScheduler
               └─3124 php /opt/fog/service/FOGTaskScheduler/FOGTaskScheduler
    

    Using my favorite command I restarted the FOG services:

    for i in FOGSnapinHash.service FOGScheduler.service  FOGImageSize.service FOGSnapinReplicator.service FOGMulticastManager.service FOGImageReplicator.service FOGPingHosts.service;do systemctl restart $i; done
    

    Now I have this at the beginning of the log:

    [03-25-21 9:06:22 am] * Starting TaskScheduler Service
    [03-25-21 9:06:22 am] * Checking for new items every 60 seconds
    [03-25-21 9:06:22 am] * Starting service loop
    [03-25-21 9:06:22 am] * 61 tasks found.
    

    Anything else I need to check to keep the service active?

    Thank you!


  • @tom-elliott said in Daily wake-up routine not working after update:

    safe

    LOL! Yeah, sure, for now! 🙂

  • Senior Developer

    @altitudehack So this is safe to solve?


  • @Tom-Elliott
    Welp, it worked. I didn’t change anything. Sorry I already ran an update (FOMO is a powerful force!) so don’t have logs from this morning.


  • Good morning @Tom-Elliott,
    It looks like it’s not working for groups. I have a single task to wake my desktop, and that’s working, but the groups target is not receiving wake-up packets.

    The scheduled task exists and looks correct:

    Screenshot from 2021-05-13 07-06-18.png

    The database entries are summarized in my last note and I haven’t made any changes.
    The schedule logs contain this at the witching hour:

    [05-13-21 6:00:44 am] * 2 tasks found.
    [05-13-21 6:00:44 am] * 1 scheduled task(s) to run.
    [05-13-21 6:00:44 am] * 1 power management task(s) to run.
    [05-13-21 6:00:44 am] * Scheduled Task run time: Thu, 13 May 2021 06:00:00 -0500
    [05-13-21 6:00:44 am] * This is a cron style task that should run now.
    [05-13-21 6:00:44 am] * Found a scheduled task that should run.
    [05-13-21 6:00:44 am] 		 - Is a group based task.
    [05-13-21 6:00:44 am] 		 - Unicaset task found!
    [05-13-21 6:00:44 am] 		 - Group Desktop Computers for Work from Home
    [05-13-21 6:00:44 am] 		 - Task started for group Desktop Computers for Work from Home!
    [05-13-21 6:00:44 am] * Power Management Task run time: Fri, 14 May 2021 05:00:00 -0500
    [05-13-21 6:00:44 am] * This is a cron style task that should not run now..
    

    However computers in the target group are still off after 6am. I can run the group task manually and it does start up. I tested both via the power-management tab and also the Basic Tasks --> Advanced --> Wake-up option and they both work.
    I did update in the past couple days so am on dev-branch version: 1.5.9.87
    Thanks!


  • @Tom-Elliott so I truncated the tables and re-created the jobs - one I created via Basic Tasks -> Advanced -> Wake up, and one I created through the Power Management window. Here’s the resulting database entries for Day of Week and Day of Month from both:

    MariaDB [fog]> select stDOM,stDOW from scheduledTasks\G
    *************************** 1. row ***************************
    stDOM: *
    stDOW: 1-5
    1 row in set (0.001 sec)
    
    MariaDB [fog]> select pmDom,pmDow from powerManagement\G
    *************************** 1. row ***************************
    pmDom: *
    pmDow: 1-5
    1 row in set (0.000 sec)
    

    So it’s looking good now. As you can see in my previous database entry, I had 1-5 entered under pmDom, which was likely the issue. I’m giving this point to user error.
    Thanks again for your help!


  • @tom-elliott Sorry I’ve been quiet, because it had been working 🙂

    However this morning it looks like it did not fire. It’s after 8am here and there’s no entry for these two at 6am on the morning of 05-06:

    [Cent-7:root@fog ~]# grep stacy /var/log/fog/fogscheduler.log 
    [05-01-21 6:00:54 am]  | Task sent to stacy-pc
    [05-02-21 6:00:44 am]  | Task sent to stacy-pc
    [05-03-21 6:00:36 am]  | Task sent to stacy-pc
    [05-04-21 6:00:27 am]  | Task sent to stacy-pc
    [05-05-21 6:00:18 am]  | Task sent to stacy-pc
    
    [Cent-7:root@fog ~]# grep luke /var/log/fog/fogscheduler.log 
    [05-01-21 6:00:54 am]  | Task sent to luke-pc
    [05-02-21 6:00:44 am]  | Task sent to luke-pc
    [05-03-21 6:00:35 am]  | Task sent to luke-pc
    [05-04-21 6:00:27 am]  | Task sent to luke-pc
    [05-05-21 6:00:18 am]  | Task sent to luke-pc
    

    I ran your mv commands and re-ran the installer.
    Then I get 21 rows of this:

    MariaDB [fog]> select * from powerManagement \G
    *************************** 1. row *************************** 
          pmID: 1              
      pmHostID: 14                                                
         pmMin: 0        
        pmHour: 6                                                  
         pmDom: 1-5
       pmMonth: *
         pmDow: *
      pmAction: wol
    pmOndemand: 0
    *************************** 2. row ***************************
          pmID: 2
      pmHostID: 26
         pmMin: 0
        pmHour: 6
         pmDom: 1-5
       pmMonth: *
         pmDow: *
      pmAction: wol
    pmOndemand: 0
    ...
    ...
    ...
    *************************** 21. row ***************************
          pmID: 21
      pmHostID: 36
         pmMin:
        pmHour:
         pmDom:
       pmMonth:
         pmDow:
      pmAction: reboot
    pmOndemand: 1
    21 rows in set (0.000 sec)
    

    and:

    MariaDB [fog]> select * from scheduledTasks\G
    *************************** 1. row ***************************
             stID: 8 
           stName: Wake-Up Task
           stDesc:
           stType: C
     stTaskTypeID: 14
         stMinute: 0
           stHour: 5
            stDOM: * 
          stMonth: *
            stDOW: 1-5
        stIsGroup:
    stGroupHostID: 49
        stImageID: 0  
       stShutDown:
         stOther1:
         stOther2: -1        
         stOther3: fog
         stOther4: 1                                                                                                                                         
         stOther5:                                                                                                                                           
       stDateTime: 0
         stActive: 1
    *************************** 2. row ***************************
             stID: 5
           stName: Single Snapin Task
           stDesc:
           stType: S
     stTaskTypeID: 13
         stMinute:
           stHour:
            stDOM:
          stMonth:
            stDOW:
        stIsGroup:
    stGroupHostID: 36
        stImageID: 0
       stShutDown:
         stOther1:
         stOther2: 13
         stOther3: fog
         stOther4:
         stOther5:
       stDateTime: 1618063200
         stActive: 0
    2 rows in set (0.001 sec)
    
  • Senior Developer

    @altitudehack The clear current tasks run the following:

    truncate table powerManagement;
    truncate table scheduledTasks;
    

    This will restart both tables to ID of 1, but hopefully after this you will be good to go.

  • Senior Developer

    @altitudehack So I created a vm and ran an installation using the latest version of dev-branch (as you are.)

    Can you please try the following steps?

    mv /var/www/fog{,_orig}
    mv /var/www/html/fog{,_orig}
    

    Then rerun the installation. I’m only asking because creating a group and applying a Power Management group properly configured the environment for me.

    MariaDB [fog]> select * from powerManagement \G
    *************************** 1. row ***************************
          pmID: 1
      pmHostID: 1
         pmMin: 15
        pmHour: 6
         pmDom: *
       pmMonth: *
         pmDow: 1-5
      pmAction: wol
    pmOndemand: 0
    

    and the scheduled task

    
    MariaDB [fog]> select * from scheduledTasks\G
    *************************** 1. row ***************************
             stID: 1
           stName: Wake-Up Task
           stDesc:
           stType: C
     stTaskTypeID: 14
         stMinute: 15
           stHour: 6
            stDOM: *
          stMonth: *
            stDOW: 1-5
        stIsGroup: 1
    stGroupHostID: 1
        stImageID: 0
       stShutDown:
         stOther1:
         stOther2: -1
         stOther3: fog
         stOther4: 1
         stOther5:
       stDateTime: 0
         stActive: 1
    1 row in set (0.000 sec)
  • Senior Developer

    @altitudehack I’m working to fix the entry points.


  • @tom-elliott

    MariaDB [fog]> SELECT * FROM powerManagement LIMIT 1 \G
    *************************** 1. row ***************************
          pmID: 1
      pmHostID: 14
         pmMin: 0
        pmHour: 6
         pmDom: 1-5
       pmMonth: *
         pmDow: *
      pmAction: wol
    pmOndemand: 0
    1 row in set (0.000 sec)
    

    So it looks like I mixed up dow & dom, explaining the May 1 schedule. It showed a scheduled start time of 2021-05-03 06:15.
    I deleted the entry from tasks > scheduled tasks, but it still returns the above. What’s the best way to purge this?

  • Senior Developer

    @altitudehack What’s the output of your powerManagement table?

    SELECT * FROM powerManagement LIMIT 1 \G

    I just want to see what entries are being seen, so I could hopefully narrow down where the issue is with putting in a new cron.


  • @tom-elliott Looks like the time/date is still confused:

    [04-30-21 8:06:09 am] * 21 tasks found.
    [04-30-21 8:06:09 am] * 1 scheduled task(s) to run.
    [04-30-21 8:06:09 am] * 20 power management task(s) to run.
    [04-30-21 8:06:09 am] * Scheduled Task run time: Mon, 03 May 2021 06:15:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1620040500
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:06:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:06:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * 21 tasks found.
    [04-30-21 8:07:09 am] * 1 scheduled task(s) to run.
    [04-30-21 8:07:09 am] * 20 power management task(s) to run.
    [04-30-21 8:07:09 am] * Scheduled Task run time: Mon, 03 May 2021 06:15:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1620040500
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    [04-30-21 8:07:09 am] * Power Management Task run time: Sat, 01 May 2021 06:00:00 -0500
    [04-30-21 8:07:09 am] * This is a cron style task that should run at: 1619866800.
    
  • Senior Developer

    @altitudehack That would be my thought. I’m guessing the logs look more normalized now?


  • @tom-elliott I just meant that before whatever caused the wake-up task(s) to stop (presumably an update prior to mid-March), I also did not have the FOG timezone set, and it was waking them up at the expected time. Which is kinda weird when I think about it…maybe it was waking them up five hours early? No one would have noticed if it was.

  • Senior Developer

    @altitudehack Can you clarify?

    What was working before the update? I know you’ve had to update multiple times, but that was because there was a problem that you reported.


  • @tom-elliott t’was working before the update! 🙂

  • Senior Developer

    @altitudehack The main one to worry about is the one for FOG. While it doesn’t hurt to set it everywhere else either.


  • @tom-elliott well that’s interesting. It was set to UTC. I was going to verify that I had it set properly in php and see two versions enabled:

    [Cent-7:root@fog ~]# php -v
    PHP 7.4.18 (cli) (built: Apr 27 2021 14:35:46) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    [Cent-7:root@fog ~]# php-fpm -v
    PHP 7.4.18 (fpm-fcgi) (built: Apr 27 2021 14:35:46)
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    

    Should one of these be removed?

    It is configured in php.ini:
    date.timezone = America/Chicago
    I’ll set it in FOG, too.

  • Senior Developer

    @altitudehack said in Daily wake-up routine not working after update:

    1619866800

    Can you verify the timezone is configured for your environment (appropriately?)

    FOG Settings -> FOG_TZ_INFO

    If you make a change restart the FOG Services please.

251
Online

8.4k
Users

15.2k
Topics

142.6k
Posts