dash does not conform to LSB (-l option, /etc/profile.d)

Bug #102105 reported by Till Kamppeter
28
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Fix Released
Low
Matthias Klose
Gutsy
Won't Fix
Low
Matthias Klose
dash (Ubuntu)
Fix Released
Low
Matthias Klose
Gutsy
Won't Fix
Low
Matthias Klose
lsb (Ubuntu)
Invalid
Low
Unassigned
Gutsy
Invalid
Low
Unassigned

Bug Description

Binary package hint: lsb

The specifications of the LSB 3.1 require from the shell (sh, bash) that it sources all *.sh scripts when started as a login shell. See

http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/etc.html

This is not the case with Ubuntu Linux and Ubuntu is certified as LSB-compliant. I have the "lsb" package installed.

A possible fix is adding

for i in /etc/profile.d/*.sh ; do
        if [ -x $i ]; then
                . $i
        fi
done

unset i

to the end of the file /etc/profile.

Another problem with the shell not being LSB-compliant is the lack of the "-l" option which is required here:

http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/sh.html#CMD-SH-INVOKE

The "-l" option serves for starting the shell as a login shell.

Related branches

Changed in bash:
importance: Undecided → High
Changed in lsb:
importance: Undecided → High
Revision history for this message
Colin Watson (cjwatson) wrote :

bash supports -l, but dash does not.

Changed in dash:
importance: Undecided → High
Revision history for this message
Matthias Klose (doko) wrote :

adding that; once we do have that we have to be careful that no package actually uses it. debian policy says that a package has to work out of the box, without changing/setting any environment variables.

Changed in bash:
assignee: nobody → doko
Revision history for this message
Matthias Klose (doko) wrote :

"The shell shall support an additional option", so this option is not required.

Revision history for this message
Matthias Klose (doko) wrote :

same for the /etc/profile.d/*.sh files: The sh utility shall read and execute commands ..."

Revision history for this message
Micah Cowan (micahcowan) wrote :

> "The shell shall support an additional option", so this option is not required.

Don't you mean, "so this option is required"? That;s what "shall support" means to me, anyway...

Note that this same behavior is required for "sh -", which has also traditionally meant "login mode" (dash supports this method, but still doesn't obey the LSB).

Revision history for this message
Tollef Fog Heen (tfheen) wrote :

Removing milestone, not RC (and bash is not /bin/sh in Ubuntu)

Revision history for this message
Tollef Fog Heen (tfheen) wrote :

Remove milestone; not RC for feisty.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Remove milestone harder, and decrease importance.

LSB issues, especially when the LSB is trying to do an end-run around both POSIX and Debian Policy (which is where this proposal originally started), are not important for us.

Changed in lsb:
importance: High → Low
Changed in dash:
importance: High → Low
Changed in bash:
importance: High → Low
Revision history for this message
Ian Murdock (imurdock) wrote :

I find this attitude disturbing. Ubuntu leadership has committed to the LSB, so it *should* be important for you. And the suggestion that this is "an end run around both POSIX and Debian Policy" is downright ridiculous. -ian

Revision history for this message
Matt Zimmerman (mdz) wrote :

Confirmed for dash

Changed in dash:
status: Unconfirmed → Confirmed
Revision history for this message
Matt Zimmerman (mdz) wrote :

I don't think the LSB applies to bash in Ubuntu, since it only standardizes /bin/sh (which on Ubuntu is dash, not bash). I would appreciate confirmation from LSB folk about this (setting to Needs Info).

Changed in bash:
status: Unconfirmed → Needs Info
Revision history for this message
Matt Zimmerman (mdz) wrote :

Dissociating from the lsb package; I don't think this has anything to do with the lsb package itself, only with compliance with the LSB specification (which is a different matter)

Changed in lsb:
status: Unconfirmed → Rejected
Revision history for this message
Gael Varoquaux (gael-varoquaux) wrote :

This issue _is_ important ! The default /bin/sh does not conform to LSB standards, and does not conform to common practice. This cause quite a few scripts fail, one of them being nautilus-open-terminal.

Revision history for this message
Micah Cowan (micahcowan) wrote :

Well, now, those are two entirely separate assertions. This particular LSB violation is hardly common practice.

What you really mean by "common practice" is GNU bashisms, which is a separate issue, and frankly, has already been talked to death (and, at the least, does not belong here).

Revision history for this message
Colin Watson (cjwatson) wrote :

Matthias, your "so this option is not required" claim doesn't match a plain English reading of the text. Please fix the two reported bugs; both are equally important and shouldn't be ignored.

Changed in dash:
assignee: nobody → doko
Revision history for this message
octoberdan (octoberdan) wrote :

I wasted a long while before discovering that Ubuntu was not LSB compliant and this bug was the source of my broken scripts. How can this only be set to low?

Revision history for this message
Matthias Klose (doko) wrote :

addressed in base-files_4.0.1ubuntu2 and dash_0.5.4-6ubuntu1

Changed in dash:
status: Confirmed → Fix Released
Changed in bash:
status: Incomplete → Fix Released
Revision history for this message
okparanoid (okparanoid) wrote :

It will very convenient to have the /etc/profile.d working like this.
I need this to adjust properly proxy settings in different networks environments.

Will this commited for hardy ?

Thanks !

Revision history for this message
okparanoid (okparanoid) wrote :

sorry for the inconvenience, it is already done. :op

Revision history for this message
Sergio Zanchetta (primes2h) wrote :

The 18 month support period for Gutsy Gibbon 7.10 has reached its end of life -
http://www.ubuntu.com/news/ubuntu-7.10-eol . As a result, we are closing the
Gutsy task.

Changed in bash (Ubuntu Gutsy):
status: Incomplete → Won't Fix
Changed in dash (Ubuntu Gutsy):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.