[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] xl command autocompletion: domain names



On Wed, Nov 6, 2013 at 11:03 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> On Wed, 2013-11-06 at 13:18 +1300, Matthew Daley wrote:
>
>> >> On Fri, Nov 1, 2013 at 4:03 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> 
>> >> wrote:
>> >> > I don't necessarily object to setting the process title, it feels a bit
>> >> > 1980s/sendmail-ish to me but that might just be me ;-)
>> >
>> > Right.
>> >
>> >> Can't say I have 80s UNIX experience ;)
>> >
>> > The problem with it from my point of view is that it's very difficult
>> > to make it reliable.  I don't mind setting the title for the benefit
>> > of admins, but automatically grepping processes out of ps listings is
>> > pretty poor and shouldn't be done in bash-completion IMO.
>>
>> A quick grep through the existing bash-completion scripts doesn't show
>> any uses of ps, so that is in your favour. I guess I'll can this idea
>> for getting the names for now then. The thing is, a completion script
>> for xl that doesn't handle domain names seems a little pointless...
>
> I presume it does handle it if you use "sudo -s" or su and run the
> commands actually as root? If so then it's not a total waste.

Which "it" are we talking about here? If you mean a xl bash-completion
script, well, that's still vapourware right now :) I wanted to try and
figure something out with these domain names first before diving into
the script since the script itself should be pretty simple AFAICT.

Using sudo -s would still have issues, since the completion still runs
as the unprivileged shell user. su'ing as root would work fine, but
one isn't supposed to be sitting in shells as root all day, no?

>
> I can't think of any alternatives. There is the R/O xenstored socket
> interface which in principal could be opened up to non-privileged users
> in dom0 and have xl use it when unprivileged. That doesn't work with
> dissag though and is probably a fair bit of work in xl.
>
> I'd also be a little wary of exposing bugs (since r/o still means you
> can send messages to the daemon, just that it will reject XS_WRITE/MKDIR
> etc).

Yeah. I wouldn't want to go changing stuff so drastically for just a
small nice-to-have feature. Especially if it involves the risk of
exposing interesting bugs to unprivileged users ;)

>
> libxl probably leaves some per-domain droppings in /var and such, but I
> don't think we'd want to expose that.

Right. The only other idea I've not mentioned yet would be to
explicitly define a file in /var or wherever which enumerated the
currently running domains (created by xl), but IMO that's silly
duplication of information which is just asking for trouble wrt.
synchronization with reality.

>
> You could autocomplete all the names found in cfg files under /etc/xen/.
> Obviously that makes sense for xl create but not so much for the others,
> although maybe it is better than nothing? Skanky though.

Well, for xl create it'd just be using normal filename completion for
the config file, nothing special needs to (nor should) be done there.
Regardless of that, doing completion this way would assume that all
the config files live under /etc/xen.

- Matthew

>
> Ian.
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.