Comment 2 for bug 639710

Revision history for this message
clayg (clay-gerrard) wrote :

I had thought about trying to use LoggerFileObject in swift-init, but of course the exec'd processes had their own agenda for sys.stdout. I hadn't thought about modifying the daemon.run and run_wsgi code to be more aggressive about closing stdio (althought maybe they should flush?)...

Hrmm... doing a fork and exec with out closing stdout... leaving child processes open to spewing errors out and about your console after swift-init has terminated...

clayg@swift:~$ swift-init object start
WARNING: Unable to increase file descriptor limit. Running as non-root?
Starting object-server...(1269 - /etc/swift/object-server/1.conf)
Starting object-server...(1270 - /etc/swift/object-server/2.conf)
Starting object-server...(1271 - /etc/swift/object-server/3.conf)
Starting object-server...(1272 - /etc/swift/object-server/4.conf)
clayg@swift:~$
clayg@swift:~$
clayg@swift:~$ Error trying to load config /etc/swift/object-server/1.conf: File contains no section headers.
file: /etc/swift/object-server/1.conf, line: 1
'DEFAULT]\n'

clayg@swift:~$

You may be right that's it's better than getting blackholed, but I hadn't thought of that. Or maybe I'm misinterpreting your comment?

Another idea I had was to setup a default root logger if there's a problem with the conf and log errors on that instead of printing?

Another error that seemed to get lost was in validate_configuration - it was calling sys.exit("error message") after stderr redirection, but it didn't show up in syslog? Changing to print "error message"; sys.exit(1) seems to work just fine. I'm not really sure why it didn't get logged before...