Skip to contentSkip to conversation

Rewritten XendLogging to not be a singleton class, and not have methods used

Xen-changelog Jeremy Katz 3 participants 5 messages Oct 10, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Xen patchbot -unstable

Log to a temporary file if permission is denied to log to /var/log/xend.log, as happens when you are not root. Fixes bug #305.

This is going to lead to a lot of ugly little files scattered through /tmp. Why not fall back to only logging critical problems to stderr instead of still trying to make sure all of the debug domain information is output to the log?

Jeremy

#2 lore raw
Quoted 9 lines · Jeremy Katz
Quoted 3 lines · Xen patchbot -unstable

Log to a temporary file if permission is denied to log to /var/log/xend.log, as happens when you are not root. Fixes bug #305.

This is going to lead to a lot of ugly little files scattered through /tmp. Why not fall back to only logging critical problems to stderr instead of still trying to make sure all of the debug domain information is output to the log?

That's certainly a possibility, and I'm not keen on having those files in /tmp, but nor did I like the idea that useful debugging information would be thrown away, given the fragility of the tools at the moment.

xm help doesn't cause any logging for me, so there's actually no file created. I don't know why else someone would be running xm as a non-privileged user -- perhaps someone who does so could speak up?

There is actually a configuration option to set the log file, so people who are using xm regularly in that mode do have the option to set the log file somewhere that they can write, thus avoiding the small files.

Ewan.

#3 lore raw

EM> xm help doesn't cause any logging for me, so there's actually no EM> file created. I don't know why else someone would be running xm EM> as a non-privileged user -- perhaps someone who does so could EM> speak up?

I think that xm should be at least able to run "help" and "help --long" as non-root. It should definitely be able to do so without a stack trace. I don't like blindly running tools as root before I at least get a chance to look at the help output as a non-root user.

Signature · 4 lines
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: [email protected]
#4 lore raw
Quoted 10 lines · Dan Smith

EM> xm help doesn't cause any logging for me, so there's actually no EM> file created. I don't know why else someone would be running xm EM> as a non-privileged user -- perhaps someone who does so could EM> speak up?

I think that xm should be at least able to run "help" and "help --long" as non-root. It should definitely be able to do so without a stack trace. I don't like blindly running tools as root before I at least get a chance to look at the help output as a non-root user.

Sure, and that works now with my fix. I would have applied your patch, but what you'd effectively done was moved the import of XendLogging so that it didn't occur when doing xm help. That seemed fragile to me, because logging is something that people will import more or less everywhere, so I've changed it so that XendLogging can recover from the permission denied without getting a stack trace.

Cheers,

Ewan.

#5 lore raw

EM> Sure, and that works now with my fix.

Great. I was really just responding to the question about who might run xm as non-root :)

EM> I would have applied your patch, but what you'd effectively done EM> was moved the import of XendLogging so that it didn't occur when EM> doing xm help.

There was mention a while back about not importing a whole pile of things to simply run a help command or the like, unless it was necessary.

I agree with Jeremy that logging inside xm seems a little strange, especially to the same place as the daemon. It makes more sense to me to expect debug information from an interactive tool on the console, and to see info from a daemon in a log file. Maybe a command-line or config-file switch to turn on debug output to stderr?

Signature · 4 lines
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: [email protected]