• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Database fails to initialize 2

Scheduled Pinned Locked Moved Solved
Bug Reports
5
24
7.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    syschuck @Tom Elliott
    last edited by syschuck Aug 23, 2016, 9:28 AM Aug 23, 2016, 3:27 PM

    @Tom-Elliott Hi Tom, here is a code fragment that will check /etc/my.cnf for the skip-networking flag and set ${snmysqlhost} appropriately. It may not always get it but I think my.cnf is pretty standard for mysql and MariaDB.

    #!/bin/sh
    
    mysqlcfg=/etc/my.cnf
    snmysqlhost='127.0.0.1' 
    if [ -f ${mysqlcfg} ]; then
      W=`grep skip-networking ${mysqlcfg} | sed "/^\s*\;/d;s/\s*\;[^\"']*$//" | sed "/^\s*#/d;s/\s*#[^\"']*$//"`
      if [ ! -z $W ]; then
        snmysqlhost='localhost' 
      fi
    fi
    echo ${snmysqlhost}
    #
    ./installfog.sh -y
    

    Tom, I think you can mark this one as solved.

    T 1 Reply Last reply Aug 23, 2016, 4:52 PM Reply Quote 1
    • T
      Tom Elliott @syschuck
      last edited by Aug 23, 2016, 4:52 PM

      @syschuck Because I always default to localhost, I think this can also be solved, however your issue brings up another potential downfall in that your patch only changes to snmysqlhost to localhost if skip-networking is on. However, if skip-networking is on, Storage Nodes won’t be able to communicate to the DB because we’ve essentially disabled networking access.

      I propose this:

      for mysqlconf in $(grep -rl '.*skip-networking' /etc); do
          sed -i '/.*skip-networking/ s/^#*/#/' -i $mysqlconf >>$workingdir/error_logs/fog_error_${version}.log 2>&1
      done
      

      This method, I think, is better in that I only comment the skip networking lines in any found mysql conf files (as I’m not aware of other configs having the skip-networking as a config). It means I don’t guess which files to edit as the return will only give us matching files.

      I already do something similar to this for bind-address (at least for ARCH and have moved them both to happen on any system.

      Hopefully this makes sense.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      S 1 Reply Last reply Aug 23, 2016, 5:22 PM Reply Quote 0
      • S
        syschuck @Tom Elliott
        last edited by Aug 23, 2016, 5:22 PM

        @Tom-Elliott That makes sense. I think there is also a /etc/my.cnf.d under ubuntu and mageia that skip-networking could be hidden under. So seems reasonable. Be aware, my.cnf has two comment characters, ‘#’ and ‘;’. That’s why my sed thing was so contorted.

        T 1 Reply Last reply Aug 23, 2016, 5:23 PM Reply Quote 0
        • T
          Tom Elliott @syschuck
          last edited by Aug 23, 2016, 5:23 PM

          @syschuck But I can guarantee the comment is done with a ‘#’ anyway.

          Unless the files are not interchangable.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • 1
          • 2
          • 2 / 2
          2 / 2
          • First post
            21/24
            Last post

          150

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project