Meik Hellmund wrote:
On Thu, 05 Mar 2009 20:12:32 -0500
Bob Doolittle <robert.doolit...@sun.com> wrote:

I hope you don't mind me putting this back on the alias, but this is significant.
It proves that Ubuntu (not Debian - my mistake) uses a different
version of "sh" than other distros (RHEL, SLES, and apparently
Debian).

Anybody know the details here? What is the Ubuntu default sh?


Bob, can you (or someone else) help me with my confusion?
The script in question,
/etc/opt/SUNWut/gdm/SunRayInit/helpers/Xsetup
starts with the line "#!/bin/ksh -p" So why is the version of /bin/sh important here?

Look again. I think there's a missing '!' character :) All this trouble for lack of one character - it hardly seems fair, does it?

The pstree output sent by Murray showed:

# cat /tmp/Xsetup.pstree.out
sh(12680)---pstree(12697)

If you look at /usr/X11/gdm/Init/DISPLAY (which is a symlink to /etc/opt/SUNWut/gdm/SunRayInit/Default), you'll see it starts with "#!/bin/sh" and it runs the files in /etc/opt/SUNWut/gdm/SunRayInit/helpers. Since we have a broken interpreter-file specification we wind up using sh (dash in this case).

If you add the missing "!" back into /etc/opt/SUNWut/gdm/SunRayInit/Default, does Xsetup work unchanged?

It's possible that we should take a greatest-common-denominator approach here and restrict syntax of these files to POSIX for broadest compatibility rather than relying on ksh. Certainly in this case the use of the extended syntax is unnecessary but we'd need to look more closely at the POSIX standard to determine whether we could easily restrict to that syntax.

At least now we know what the issue is. Thanks folks. I'll file a bug and probably submit a patch request.

-Bob

For a "default shell" script I would see the issue. Such
scripts should conform to the POSIX standard in the Ubuntu/Debian world,
since /bin/sh may be provided by any POSIX compatible shell,
e.g., bash or dash. Older Debian installations or upgrade of
older installations (like mine) use bash as default, new ones since
Debian 5.0 (and  Ubuntu already since 6.06) use dash, since it is
leaner and faster. The default login shell is bash since it has
more interactive capabilities. See <https://wiki.ubuntu.com/DashAsBinSh> which also mentions the function keyword as a POSIX incompatible "bashism". But the script in question is a designated ksh script and ksh accepts the function keyword. What do I miss here?

Meik

_______________________________________________
SunRay-Users mailing list
SunRay-Users@filibeto.org
http://www.filibeto.org/mailman/listinfo/sunray-users

Reply via email to