FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 05-12-2010, 06:09 PM
"Robert P. J. Day"
 
Default how to relink /bin/sh away from dash -- update-alternatives?

*sigh*. it's embarrassing to ask trivial questions like this but,
sometimes, google just doesn't come through and i'm still feeling my
way around ubuntu.

i'm setting up to build openembedded on my lynx box, and the sanity
check run by bitbake strongly recommends that i don't leave /bin/sh
linked to dash. currently, there's a symlink /bin/sh -> dash. but
i'm assuming this is managed by the "alternatives" feature, yet:

$ sudo update-alternatives --config sh
update-alternatives: error: no alternatives for sh.
$

what am i screwing up? i'm just about to run

$ sudo update-alternatives --all

to see what's happening.

rday

--

================================================== ======================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
================================================== ======================

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-12-2010, 06:18 PM
Tony Arnold
 
Default how to relink /bin/sh away from dash -- update-alternatives?

Robert,

On 12/05/10 19:09, Robert P. J. Day wrote:
>
> *sigh*. it's embarrassing to ask trivial questions like this but,
> sometimes, google just doesn't come through and i'm still feeling my
> way around ubuntu.
>
> i'm setting up to build openembedded on my lynx box, and the sanity
> check run by bitbake strongly recommends that i don't leave /bin/sh
> linked to dash. currently, there's a symlink /bin/sh -> dash. but
> i'm assuming this is managed by the "alternatives" feature, yet:
>
> $ sudo update-alternatives --config sh
> update-alternatives: error: no alternatives for sh.
> $
>
> what am i screwing up? i'm just about to run

Nothing. If sh wedre managed by the alternatives system, then /bin/sh
would link to /etc/alternatives/sh which would link to /bin/dash.

Unlinking /bin/sh seems very dangerous to me as sh is needed for the
boot scripts to run!

Why does bitbake make this strange recommendation?

Regards,
Tony.
--
Tony Arnold, Tel: +44 (0) 161 275 6093
Head of IT Security, Fax: +44 (0) 870 136 1004
University of Manchester, Mob: +44 (0) 773 330 0039
Manchester M13 9PL. Email: tony.arnold@manchester.ac.uk

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-12-2010, 06:28 PM
"Robert P. J. Day"
 
Default how to relink /bin/sh away from dash -- update-alternatives?

On Wed, 12 May 2010, Tony Arnold wrote:

> Robert,
>
> On 12/05/10 19:09, Robert P. J. Day wrote:
> >
> > *sigh*. it's embarrassing to ask trivial questions like this
> > but, sometimes, google just doesn't come through and i'm still
> > feeling my way around ubuntu.
> >
> > i'm setting up to build openembedded on my lynx box, and the
> > sanity check run by bitbake strongly recommends that i don't leave
> > /bin/sh linked to dash. currently, there's a symlink /bin/sh ->
> > dash. but i'm assuming this is managed by the "alternatives"
> > feature, yet:
> >
> > $ sudo update-alternatives --config sh update-alternatives: error:
> > no alternatives for sh. $
> >
> > what am i screwing up? i'm just about to run
>
> Nothing. If sh wedre managed by the alternatives system, then
> /bin/sh would link to /etc/alternatives/sh which would link to
> /bin/dash.

ah, of course, i knew that. :-)

> Unlinking /bin/sh seems very dangerous to me as sh is needed for the
> boot scripts to run!

i realize that, which is why i wanted to ask smarter people than me
about it.

> Why does bitbake make this strange recommendation?

i can ask. here's the python excerpt from the bitbake sanity
checker code:

try:
if os.path.basename(os.readlink('/bin/sh')) == 'dash':
messages = messages + "Using dash as /bin/sh
causes various subtle build problems, please use bash instead.
"
except:
pass



what the "subtle build problems" are, i have no idea. i'll see if i
can find out. beyond that, is there a known reason that /bin/sh
*shouldn't* link to bash? i can simply readjust the symlink, but
making a change that fundamental makes me nervous.

rday

--

================================================== ======================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
================================================== ======================

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-12-2010, 06:30 PM
Tom H
 
Default how to relink /bin/sh away from dash -- update-alternatives?

On Wed, May 12, 2010 at 2:09 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> **sigh*. *it's embarrassing to ask trivial questions like this but,
> sometimes, google just doesn't come through and i'm still feeling my
> way around ubuntu.
>
> *i'm setting up to build openembedded on my lynx box, and the sanity
> check run by bitbake strongly recommends that i don't leave /bin/sh
> linked to dash. *currently, there's a symlink /bin/sh -> dash. *but
> i'm assuming this is managed by the "alternatives" feature, yet:
>
> $ sudo update-alternatives --config sh
> update-alternatives: error: no alternatives for sh.
> $
>
> *what am i screwing up? *i'm just about to run
>
> $ sudo update-alternatives --all
>
> to see what's happening.

dpkg-reconfigure dash

You can use update-alternatives but you first have to create and then
configure it...

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-12-2010, 06:32 PM
"Robert P. J. Day"
 
Default how to relink /bin/sh away from dash -- update-alternatives?

On Wed, 12 May 2010, Tony Arnold wrote:

> Robert,
>
> On 12/05/10 19:09, Robert P. J. Day wrote:
> >
> > *sigh*. it's embarrassing to ask trivial questions like this but,
> > sometimes, google just doesn't come through and i'm still feeling my
> > way around ubuntu.
> >
> > i'm setting up to build openembedded on my lynx box, and the sanity
> > check run by bitbake strongly recommends that i don't leave /bin/sh
> > linked to dash. currently, there's a symlink /bin/sh -> dash. but
> > i'm assuming this is managed by the "alternatives" feature, yet:
> >
> > $ sudo update-alternatives --config sh
> > update-alternatives: error: no alternatives for sh.
> > $
> >
> > what am i screwing up? i'm just about to run
>
> Nothing. If sh wedre managed by the alternatives system, then /bin/sh
> would link to /etc/alternatives/sh which would link to /bin/dash.
>
> Unlinking /bin/sh seems very dangerous to me as sh is needed for the
> boot scripts to run!
>
> Why does bitbake make this strange recommendation?

ok, google comes through with the proposed solution:

http://wiki.openembedded.net/index.php/OEandYourDistro

"Check that /bin/sh (ls -l /bin/sh) is not symbolically linked to
dash. "dash" is a POSIX compliant shell that is much smaller than
"bash" -- however some broken shell scripts still make use of bash
extensions while calling into /bin/sh. To work around this issue call
"sudo dpkg-reconfigure dash" and select No when it asks you to install
dash as /bin/sh. "

i can live with that explanation.

rday


--

================================================== ======================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
================================================== ======================

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-12-2010, 11:56 PM
Florian Diesch
 
Default how to relink /bin/sh away from dash -- update-alternatives?

"Robert P. J. Day" <rpjday@crashcourse.ca> writes:


> beyond that, is there a known reason that /bin/sh *shouldn't* link to
> bash?

Some broken shell scripts assume that /bin/sh is bash. That's a
bug. They should be fixed to either use only POSIX sh features with
/bin/sh or explicitly use bash if they need it.



Florian
--
<http://www.florian-diesch.de/doc/emacs/>

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-13-2010, 12:44 AM
Tom H
 
Default how to relink /bin/sh away from dash -- update-alternatives?

On Wed, May 12, 2010 at 7:56 PM, Florian Diesch <diesch@spamfence.net> wrote:
> "Robert P. J. Day" <rpjday@crashcourse.ca> writes:
>>
>> beyond that, is there a known reason that /bin/sh *shouldn't* link to
>> bash?
>
> Some broken shell scripts assume that /bin/sh is bash. That's a
> bug. They should be fixed to either use only POSIX sh features with
> /bin/sh or explicitly use bash if they need it.

Even though it is basically semantics, I would not quite call these
scripts broken since all they need to run properly is a change in
their shebang line to /bin/bash (or divert /bin/sh to /bin/bash).
Semantics, I know, but changing a shebang line to ensure that a
bashism is understood is much easier than actual debugging.

If /bin/sh were a "real" statically-linked /bin/sh, you would be
better off not diverting it to /bin/bash. Since both /bin/bash and
/bin/dash are dynamically-linked, it doesn't matter...

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 02:01 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org