f.lux

    f.lux forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    xflux gets stuck in a loop when stdin is /dev/null

    Linux
    2
    3
    3485
    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.
    • G
      gfxmonk last edited by

      I set up a systemd user service for xflux, which (by default) will attach stdin to /dev/null, because most daemons never touch stdin.

      xflux ran without errors, but never actually changed colours - doing an strace revealed that it was reading from stdin in a loop. I can't find any information about what xflux does with stdin, but piping /dev/urandom into it started changing screen colours fairly wildly - so I'm assuming it's a feature to alter configuration while xflux is running, rather than having to restart with new command line flags.

      Anyway, it would be great if xflux could detect EOF and stop trying to read from stdin, because this was pretty hard to track down, and the workaround is pretty obtuse (I got systemd to also create a unix socket connected to stdin, and just never connect anything to the other end).

      1 Reply Last reply Reply Quote 0
      • herf
        herf last edited by

        Yes this is for our GUI, but it should probably be turned off after fork - good bug.
        We're doing a nonblocking select() on stdin, which normally doesn't block.

        We will likely do a domain socket instead of this broken stdin command stream as soon as we get someone to fix up the python gui.

        Basically all of our bugs on Linux are due to the stdin parser, so I will be glad to be rid of it!

        1 Reply Last reply Reply Quote 0
        • G
          gfxmonk last edited by

          Thanks, good to hear!

          Although just to note, you say "it should probably be turned off after fork". For my systemd service, I'm also using -nofork, because having daemons fork themselves is usually unnecessary with systemd, and it's simpler if they don't try. So hopefully the fix can work even in foreground-mode.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors