Skip to content
Snippets Groups Projects
  • Iustin Pop's avatar
    Properly log errors when setting up daemon FDs · 1a865afe
    Iustin Pop authored
    
    While writing the pipe-based reporting and trying various ways to
    break the startup, I fought for a while trying to understand why error
    reporting was _different_ when running the daemon as a user (with no
    rights). It turns out that setupDaemonFDs wants to open the log file
    in append mode way before, so we are not protected by the 'prepare'
    phase.
    
    This patch explicitly runs the 'setupDaemonFDs' function under the
    same handler as the prepare phase, with the only change that here we
    instruct handlePrepErr to not log the message via log*, since logging
    is not yet set up.
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    1a865afe