[libvirt] [jenkins-ci PATCH 03/10] guests: Add custom shell profile

Andrea Bolognani abologna at redhat.com
Fri Apr 6 13:10:18 UTC 2018


On Fri, 2018-04-06 at 14:58 +0200, Pavel Hrdina wrote:
> > diff --git a/guests/templates/bash_profile b/guests/templates/bash_profile
> > new file mode 100644
> > index 0000000..a82a60e
> > --- /dev/null
> > +++ b/guests/templates/bash_profile
> > @@ -0,0 +1 @@
> > +test -f ~/.bashrc && . ~/.bashrc
> > diff --git a/guests/templates/bashrc b/guests/templates/bashrc
> > new file mode 100644
> > index 0000000..6640da6
> > --- /dev/null
> > +++ b/guests/templates/bashrc
> > @@ -0,0 +1 @@
> > +export PS1="[\u@\h \w]\$ "
> 
> I think that we should also load the system profile /etc/profile .. in
> case of 'jenkins' flavor we don't actually need it since that is used in
> automated tests but in case of 'test' flavor when developer will
> manually login into the guests might miss some features configured by
> thy system profile.

What kind of features are you thinking about, exactly?

/etc/profile can vary significantly between Linux versions, and on
FreeBSD it's not even loaded when using bash as the login shell
IIUC; however, in all cases the resulting environment is generally
pretty sane, so adding our own custom settings on top through the
user's profile works nicely.

Moreover, overriding setting in the user's profile instead of
tweaking them globally is a better approach in general IMHO, so if
there are specific features you'd like to address I would still
rather deal with them in the user's profile if at all possible.

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list