PHP Warning service_lib.php


  • Developer

    I have problems with the size of /var/log messages files because his size is huge. The reason is that all FOG service are logging in it, and all service give the same warning:

    FOGMulticastManager: PHP Warning:  sleep() expects parameter 1 to be long, string given in /opt/fog/service/lib/service_lib.php on line 55
    

    The function uses the variable $service_sleep_time. The value of this variable is:

    $service_sleep_time = $FOGCore->getSetting('SERVICESLEEPTIME'); [line 4 of the file]
    

    But the SERVICESLEEPTIME value is defined in lib/fog/config.class.php:

    define('SERVICESLEEPTIME',3); [line 44]
    

  • Developer

    It is solved with the last version 6150


  • Developer

    Can do it later? Hera is 14:35, time to eat … and I go late :)


  • Senior Developer

    @Fernando-Gietz can you hit me up on chat and maybe we can teamviewer?


  • Developer

    I can’t update the version :laughing:

    Some errors appear in the installer process:

    [root@fog6 bin]# ./installfog.sh 
    ../lib/common/functions.sh: línea 1557: error sintáctico cerca del elemento inesperado `<<<'
    ../lib/common/functions.sh: línea 1557: `<<<<<<< .mine'
    
    ./installfog.sh: línea 503: configureHttpd: no se encontró la orden
    ./installfog.sh: línea 528: configureDHCP: no se encontró la orden
    

  • Senior Developer

    @Fernando-Gietz Can you potentially teamviewer? I am pretty sure I know what’s wrong.

    Maybe try:

    Before running them, please backup any custom files you may have (iso’s, pics, whatnot)

    rm -f /var/www/fog
    rm -rf /var/www/html/fog
    

    Then rerun the installer. You should be okay with:

    ./installfog.sh -y


  • Developer

    The fog settings say Version: 5844
    SVN info :

    [root@fog6 fog]# svn info
    Ruta: .
    Working Copy Root Path: /root/fog
    URL: https://svn.code.sf.net/p/freeghost/code/trunk
    Raíz del repositorio: https://svn.code.sf.net/p/freeghost/code
    UUID del repositorio: 71f96598-fa45-0410-b640-bcd6f8691b32
    Revisión: 4722
    Tipo de nodo: directorio
    Agendado: normal
    Autor del último cambio: masterzune
    Revisión del último cambio: 4722
    Fecha de último cambio: 2016-01-26 02:12:03 +0100 (mar 26 de ene de 2016)
    

  • Senior Developer

    @Fernando-Gietz What version are you running?


  • Developer

    My globalSettings table:

    MariaDB [fog]> select settingKey , settingValue from globalSettings;
    +--------------------------------------+-----------------------------------------------------------------------+
    | settingKey                           | settingValue                                                          |
    +--------------------------------------+-----------------------------------------------------------------------+
    | FOG_TFTP_HOST                        | 10.XXX.XX.X                                                             |
    | FOG_TFTP_FTP_USERNAME                | fog                                                                   |
    | FOG_TFTP_FTP_PASSWORD                | x                                                          |
    | FOG_MINING_PACKAGE_PATH              | http://fogproject.org/fogpackage.zip                                  |
    | FOG_TFTP_PXE_KERNEL_DIR              | /var/www/html/fog/service/ipxe/                                       |
    | FOG_TFTP_PXE_KERNEL                  | bzImage_3_18_4                                                        |
    | FOG_KERNEL_RAMDISK_SIZE              | 127000                                                                |
    | FOG_USE_SLOPPY_NAME_LOOKUPS          | 1                                                                     |
    | FOG_MEMTEST_KERNEL                   | memtest.bin                                                           |
    | FOG_PXE_BOOT_IMAGE                   | init.xz                                                               |
    | FOG_PXE_IMAGE_DNSADDRESS             | 10.XXX.XX.X                                                            |
    | FOG_VIEW_DEFAULT_SCREEN              | search                                                                |
    | FOG_ADVANCED_MENU_LOGIN              |                                                                       |
    | FOG_STORAGENODE_MYSQLPASS            | fs30398394677                                                         |
    | FOG_STORAGENODE_MYSQLUSER            | fogstorage                                                            |
    | FOG_NFS_BANDWIDTHPATH                | /fog/status/bandwidth.php                                             |
    | FOG_UPLOADRESIZEPCT                  | 5                                                                     |
    | FOG_WEB_HOST                         | 10.XXX.XX.X                                                             |
    | FOG_WEB_ROOT                         | /fog/                                                                 |
    | FOG_EFI_BOOT_EXIT_TYPE               | exit                                                                  |
    | FOG_SNAPINDIR                        | /opt/fog/snapins/                                                     |
    | FOG_QUEUESIZE                        | 10                                                                    |
    | FOG_CHECKIN_TIMEOUT                  | 600                                                                   |
    | FOG_USER_MINPASSLENGTH               | 4                                                                     |
    | FOG_USER_VALIDPASSCHARS              | 1234567890ABCDEFGHIJKLMNOPQRSTUVWZXYabcdefghijklmnopqrstuvwxyz_()^!#- |
    | FOG_NFS_ETH_MONITOR                  | ens192                                                                |
    | FOG_UDPCAST_INTERFACE                | ens192                                                                |
    | FOG_UDPCAST_STARTINGPORT             | 65396                                                                 |
    | FOG_MULTICAST_MAX_SESSIONS           | 64                                                                    |
    | FOG_REPORT_DIR                       | ./reports/                                                            |
    | FOG_THEME                            | default/fog.css                                                       |
    | FOG_UPLOADIGNOREPAGEHIBER            | 1                                                                     |
    | FOG_SERVICE_DIRECTORYCLEANER_ENABLED | 1                                                                     |
    | FOG_USE_ANIMATION_EFFECTS            | 1                                                                     |
    | FOG_SERVICE_USERCLEANUP_ENABLED      |                                                                       |
    | FOG_SERVICE_GREENFOG_ENABLED         | 1                                                                     |
    | FOG_SERVICE_AUTOLOGOFF_ENABLED       | 1                                                                     |
    | FOG_SERVICE_DISPLAYMANAGER_ENABLED   | 1                                                                     |
    | FOG_SERVICE_DISPLAYMANAGER_X         | 1024                                                                  |
    | FOG_SERVICE_DISPLAYMANAGER_Y         | 768                                                                   |
    | FOG_SERVICE_DISPLAYMANAGER_R         | 60                                                                    |
    | FOG_SERVICE_AUTOLOGOFF_MIN           | 0                                                                     |
    | FOG_SERVICE_AUTOLOGOFF_BGIMAGE       | c:\program files\fog\images\alo-bg.jpg                                |
    | FOG_KEYMAP                           |                                                                       |
    | FOG_SERVICE_HOSTNAMECHANGER_ENABLED  | 1                                                                     |
    | FOG_SERVICE_SNAPIN_ENABLED           | 1                                                                     |
    | FOG_KERNEL_ARGS                      |                                                                       |
    | FOG_SERVICE_CLIENTUPDATER_ENABLED    | 1                                                                     |
    | FOG_SERVICE_HOSTREGISTER_ENABLED     | 1                                                                     |
    | FOG_SERVICE_PRINTERMANAGER_ENABLED   | 1                                                                     |
    | FOG_SERVICE_TASKREBOOT_ENABLED       | 1                                                                     |
    | FOG_SERVICE_USERTRACKER_ENABLED      | 1                                                                     |
    | FOG_CHANGE_HOSTNAME_EARLY            | 1                                                                     |
    | FOG_PIGZ_COMP                        | 3                                                                     |
    | FOG_KEY_SEQUENCE                     |                                                                       |
    | FOG_FORMAT_FLAG_IN_GUI               |                                                                       |
    | FOG_PROXY_USERNAME                   |                                                                       |
    | FOG_PROXY_PASSWORD                   |                                                                       |
    | FOG_NO_MENU                          |                                                                       |
    | FOG_TFTP_PXE_KERNEL_32               | bzImage32                                                             |
    | FOG_PXE_BOOT_IMAGE_32                | init_32.xz                                                            |
    | FOG_MINING_ENABLE                    | 1                                                                     |
    | FOG_BOOT_EXIT_TYPE                   | sanboot                                                               |
    | FOG_MINING_MAX_CORES                 | 1                                                                     |
    | FOG_MINING_FULL_RESTART_HOUR         | 6                                                                     |
    | FOG_MINING_FULL_RUN_ON_WEEKEND       | 1                                                                     |
    | FOG_DATA_RETURNED                    | 0                                                                     |
    | FOG_QUICKREG_GROUP_ASSOC             |                                                                       |
    | FOG_ALWAYS_LOGGED_IN                 |                                                                       |
    | FOG_INACTIVITY_TIMEOUT               | 1                                                                     |
    | FOG_REGENERATE_TIMEOUT               | 0.5                                                                   |
    | FOG_TASK_FORCE_REBOOT                |                                                                       |
    | FOG_SERVICE_CHECKIN_TIME             | 60                                                                    |
    | FOG_UDPCAST_MAXWAIT                  | 10                                                                    |
    | FOG_CLIENT_MAXSIZE                   | 204800000                                                             |
    | FOG_KERNEL_DEBUG                     |                                                                       |
    | FOG_KERNEL_LOGLEVEL                  | 4                                                                     |
    | FOG_AD_DEFAULT_PASSWORD_LEGACY       |                                                                       |
    | FOG_NONREG_DEVICE                    |                                                                       |
    | FOG_TORRENT_INTERVAL                 | 1800                                                                  |
    | FOG_TORRENT_TIMEOUT                  | 120                                                                   |
    | FOG_TORRENT_INTERVAL_MIN             | 60                                                                    |
    | FOG_TORRENT_PPR                      | 20                                                                    |
    | FOG_TORRENTDIR                       | /opt/fog/torrents/                                                    |
    | FOG_MEMORY_LIMIT                     | 128                                                                   |
    | FOG_EMAIL_ACTION                     |                                                                       |
    | FOG_EMAIL_ADDRESS                    |                                                                       |
    | FOG_EMAIL_BINARY                     | /usr/sbin/sendmail -t -f noreply@${server-name}.com -i                |
    | FOG_FROM_EMAIL                       | noreply@${server-name}.com                                            |
    | FOG_PXE_HIDDENMENU_TIMEOUT           | 3                                                                     |
    | FOG_USED_TASKS                       | 1,2,8,17                                                              |
    | FOG_GRACE_TIMEOUT                    | 60                                                                    |
    | FOG_SNAPIN_LIMIT                     | 0                                                                     |
    | FOG_MULTICAST_ADDRESS                | 239.0.104.1                                                           |
    | FOG_MULTICAST_PORT_OVERRIDE          | 0                                                                     |
    | FOG_MULTICAST_DUPLEX                 | --full-duplex                                                         |
    | FOG_REGISTRATION_ENABLED             | 1                                                                     |
    | FOG_TZ_INFO                          | UTC                                                                   |
    | FOG_FTP_PORT                         | 21                                                                    |
    | FOG_FTP_TIMEOUT                      | 90                                                                    |
    +--------------------------------------+-----------------------------------------------------------------------+
    127 rows in set (0.00 sec)
    

  • Senior Developer

    @Fernando-Gietz Can you show me your FOG Linux Service stuff from FOG Settings?

    It sounds, to me, like your db doesn’t have these entries for some reason.


  • Developer

    @Claude-Girard said:

    Hi Tom

    I think line 55 in service_lib.php should be:
    sleep((int)$service_sleep_time);

    I change this line, like Claude suggests, and appears other error:

    feb 01 13:18:50 fog6.lgp.ehu.es FOGTaskScheduler[2406]: PHP Warning:  fopen(//): failed to open stream: Is a directory in /opt/fog/service/lib/service_lib.php on line 8
    feb 01 13:18:50 fog6.lgp.ehu.es FOGTaskScheduler[2406]: PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in /opt/fog/service/lib/service_lib.php on line 9
    feb 01 13:18:50 fog6.lgp.ehu.es FOGTaskScheduler[2406]: PHP Warning:  fflush() expects parameter 1 to be resource, boolean given in /opt/fog/service/lib/service_lib.php on line 10
    feb 01 13:18:50 fog6.lgp.ehu.es FOGTaskScheduler[2406]: PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /opt/fog/service/lib/service_lib.php on line 11```

  • Developer

    @Tom-Elliott said:

    SERVICESLEEPTIME is not defined in config.class.php anymore (not at least how you’re seeing it.)

    I changed all the sleeptimes and even the log driven values to come from the Database. Please check FOG Configuration->FOG Settings->FOG Linux Service Sleep Times and look at the values, are they defined appropriately?

    I don’t have this option in my FOG server :astonished: and in the database doesn’t appear any registry (globalSettings table) about it



  • Hi Tom

    I think line 55 in service_lib.php should be:
    sleep((int)$service_sleep_time);


  • Senior Developer

    SERVICESLEEPTIME is not defined in config.class.php anymore (not at least how you’re seeing it.)

    I changed all the sleeptimes and even the log driven values to come from the Database. Please check FOG Configuration->FOG Settings->FOG Linux Service Sleep Times and look at the values, are they defined appropriately?


Log in to reply
 

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.