1. 06 Oct, 2014 1 commit
    • Apollon Oikonomopoulos's avatar
      ganeti.daemon: fix daemon mode with GnuTLS >= 3.3 · 6e06de4e
      Apollon Oikonomopoulos authored
      Newer GnuTLS versions (>= 3.3.0) use a library constructor for
      initialization and open /dev/urandom on library load, way before we
      fork(). Closing /dev/urandom on fork causes a failure to re-seed GnuTLS's
      random number generator during the first ganeti.http.client request, which
      in turn causes the process to silently abort(3).
      
      For more background on this behavior, see this thread at the GnuTLS
      mailing list:
      
      http://lists.gnupg.org/pipermail/gnutls-help/2014-April/003429.html
      
      Note that calling pycurl.global_init() at the correct place (as we do) is not
      enough, as it does not cause a re-initialization of the GnuTLS library.
      
      As we cannot reliably detect neither the GnuTLS version, nor the socket, we
      work our way around this by keeping all fds referring to /dev/urandom open
      after fork. We do so using the /proc/self/fd interface.
      
      This fixes issues #961 and #964.
      
      Note that this would not affect the Haskell daemons using cURL + GnuTLS,
      because we don't close all file descriptors on fork there.
      Signed-off-by: default avatarApollon Oikonomopoulos <apoikos@gmail.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      6e06de4e
  2. 12 Sep, 2014 1 commit
  3. 22 May, 2014 1 commit
  4. 07 Feb, 2014 1 commit
  5. 13 Jan, 2014 1 commit
  6. 18 Sep, 2013 1 commit
  7. 28 May, 2013 1 commit
  8. 27 Sep, 2012 1 commit
  9. 18 Sep, 2012 1 commit
    • Michael Hanselmann's avatar
      constants: Move most paths to separate module · 3329f4de
      Michael Hanselmann authored
      This is inpreparation for the implementation of virtual clusters. Many
      paths will change based on an environment variable and are no longer
      constant and should no longer be in “constants.py”. Since “constants.py”
      is already huge a number of other paths are also moved in the process.
      
      For now a wildcard import is used to re-export all paths from
      “constants.py” (this will change over coming patches). Daemon log paths
      have been changed to use a function. “RUN_GANETI_DIR” was moved to
      “RUN_DIR” as the latter was only used in “constants.py”.
      Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      3329f4de
  10. 23 Aug, 2012 1 commit
    • Iustin Pop's avatar
      Bump pep8 version to 1.2 · 5ae4945a
      Iustin Pop authored
      Debian Wheezy will ship with this version, and it has many improved checks compared to 0.6, so let's:
      
      - bump version in the docs
      - silence some new checks that are wrong due to our indent=2 instead of 4
      - fix lots of errors in the code where the indentation was wrong by 1
        or 2 spaces
      - fix a few cases of == True, False, None and replace with 'is'
      - re-indent some cases where the code is OK, but pep8 complains
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      5ae4945a
  11. 28 Feb, 2012 1 commit
  12. 21 Feb, 2012 1 commit
  13. 08 Dec, 2011 1 commit
  14. 21 Nov, 2011 3 commits
  15. 30 Aug, 2011 1 commit
  16. 25 Jul, 2011 1 commit
  17. 24 May, 2011 1 commit
  18. 04 Apr, 2011 1 commit
    • Iustin Pop's avatar
      daemon.py: move startup log message before prep_fn · fe295df3
      Iustin Pop authored
      Before this, the output in the rapi daemon log was:
      2011-04-04 03:09:51,026: ganeti-rapi pid=17447 INFO Reading users file
      at /var/lib/ganeti/rapi/users
      2011-04-04 03:09:51,027: ganeti-rapi pid=17447 INFO ganeti-rapi daemon
      startup
      
      Which is confusing, as it might look like the read of the users file
      is part of the previous run. This is because we log the 'daemon
      startup' message after the prepare_fn, which can log things on its
      own.
      
      The patch simply moves the 'daemon startup' message just before
      prepare_fn call.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      fe295df3
  19. 02 Feb, 2011 2 commits
  20. 11 Jan, 2011 3 commits
  21. 07 Oct, 2010 5 commits
    • Iustin Pop's avatar
      Fix a rare bug in StartDaemonChild and GenericMain · ed3920e3
      Iustin Pop authored
      I've seen cases where the result from str(sys.exc_info()[1]) is ""; this
      breaks the error reporting as the parent relies on non-empty error
      messages to properly detect child status (otherwise it will try to read
      the pid and fail, so on).
      
      While this was always in case of asserts, we need to ensure this doesn't
      happen. Therefore we abstract this functionality (writing the error
      message) and ensure we write a non-empty string in the new function.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      ed3920e3
    • Iustin Pop's avatar
      Enhance the error reporting · 3e87c1bf
      Iustin Pop authored
      Since daemon startup error will be often related to socket errors, so it
      makes sense to change the original reporting:
      
        Error when starting daemon process: "(98, 'Address already in use')"
      
      Into:
      
        Error when starting daemon process: 'Socket-related error: Address
        already in use (errno=98)'
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      3e87c1bf
    • Iustin Pop's avatar
      Change daemon.GenericMain/utils.Daemonize workflow · b78aa8c2
      Iustin Pop authored
      This patch copies the pipe-based error reporting functionality from
      utils.StartDaemon (I gave up for now on tryin to merge the two).
      
      This patch will fix two longstanding bugs:
      
      - if we fork, we lose all error reporting from the child to the original
        parent
      - if we fork, the original parent exits before the child is ready to
        "work" (whatever the work might be)
      
      Both these are fixed once the users of daemon.GenericMain are converted
      to the three-state setup, as we'll get error reporting via the pipe and
      also not exit until the PrepFn is done.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      b78aa8c2
    • Iustin Pop's avatar
      Change utils.GenericMain protocol · b42ea9ed
      Iustin Pop authored
      Currently, GenericMain does a two-staged workflow:
      
      - Check, before forking
      - then Exec, after forking
      
      This means we don't have any possibility to treat preparation work
      (before the daemon is ready for work) different from the actual work.
      
      The patch adds another PreExec function that is run just before Exec,
      and which should ensure that the daemon is ready for serving client
      before it returns. Its result is then sent as the third argument to
      Exec.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      b42ea9ed
    • Iustin Pop's avatar
      Use only one version of WritePidFile · 5c4d37f9
      Iustin Pop authored
      This patch merges the pid file handling used for ganeti-* daemons and
      impexp daemons. The latter version is used, since it's more reliable:
      uses locked pid files as opposed to checking 'live' processes.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      5c4d37f9
  22. 16 Sep, 2010 1 commit
  23. 07 Sep, 2010 2 commits
  24. 27 Aug, 2010 1 commit
    • Manuel Franceschini's avatar
      Handle ENOENT case in ssconf.GetPrimaryIPFamily · 7dd999fc
      Manuel Franceschini authored
      This patch adds an optional default parameter to SimpleStore._ReadFile. This
      can be used to default the return value of this method in case the ssconf file
      is not present.
      
      In this particular case it is used to return AF_INET in case
      ssconf_primary_ip_familiy is absent. This is the case when upgrading
      from 2.2 -> 2.3. This is intended behaviour as it is suboptimal to copy
      the ssconf file manually to the nodes during an upgrade using
      cfgupgrade.
      
      In the concrete case of an upgrade from 2.2 -> 2.3 cfgupgrade will just
      add the primary_ip_family parameter to the cluster configuration and the
      daemons will start with default family AF_INET. This is perfectly fine,
      since there is no AF_INET6 2.2 clusters. After that, the admin is
      required (as in an major upgrade) to run 'gnt-cluster redist-conf' which
      will write ssconf_primary_ip_family on all nodes.
      Signed-off-by: default avatarManuel Franceschini <livewire@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      7dd999fc
  25. 23 Aug, 2010 1 commit
  26. 19 Aug, 2010 1 commit
  27. 18 Aug, 2010 1 commit
  28. 12 Jul, 2010 1 commit
    • Manuel Franceschini's avatar
      Confd IPv6 support · d8bcfe21
      Manuel Franceschini authored
      This patch series basically adds a new parameter 'family' to the constructors
      of daemon.AsyncUDPSocket and confd.client.ConfdUDPClient. This enables the
      users of these two classes to support IPv6.
      
      In ganeti-confd.ConfdAsyncUDPClient a method to check the address families of
      all peers is added.
      
      Furthermore it adds unittests for the added functionality.
      Signed-off-by: default avatarManuel Franceschini <livewire@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      d8bcfe21
  29. 09 Jul, 2010 1 commit
  30. 30 Jun, 2010 1 commit