The startxfce4 script doesn't start XFCE at all on Solaris. The problem is that the Solaris /bin/sh is really primitive, and can't cope with the xinitrc file in 4.6.1. Simplest fix is to replace prog=/bin/sh with prog=/bin/bash in startxfce4, which means that the xinitrc file will be run by an adequately capable shell.
Tempting, but I'd prefer to replace the bash-isms with safe sh equivalents. Patch?
Here checkbashisms doesn't report anything for startxfce4 (4.6.1). (checkbashsisms is a debian tool to find bashisms in /bin/sh scripts). It only checks for non-posix stuff, meaning a /bin/sh script should work with any posix-compliant sh. I guess your /bin/sh in solaris isn't posix or something. Could you check which lines are problematic?
It's probably in xinitrc, not in startxfce4.
Created attachment 2449 make xinitrc compatible with Solaris sh The problem is with xinitrc, so we could either fix starxfce4 to run it with a more capable shell, or replace the one-line export FOO=bar with FOO=bar export FOO which is what the attached patch does.
Good point. checkbashisms against xinitrc reports: corsac@hidalgo: checkbashisms debian/xfce/desktop/xfce-utils/scripts/xinitrc.in possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 4 ($UID should be "$(id -ru)"): if test "x$UID" = "x"; then possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 31 (type): if type xdg-user-dirs-update >/dev/null 2>&1; then possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 36 (should be '.', not 'source'): source "$XDG_CONFIG_HOME/user-dirs.dirs" possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 91 ($UID should be "$(id -ru)"): if test $UID -gt 0 -a -z "$VNCSESSION"; then possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 168 (type): type "$trycmd" >/dev/null 2>&1 || continue possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 172 (type): if test "$cmd" && type "$cmd" >/dev/null 2>&1; then
(In reply to comment #5) > Good point. checkbashisms against xinitrc reports: > > corsac@hidalgo: checkbashisms debian/xfce/desktop/xfce-utils/scripts/xinitrc.in > possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 4 > ($UID should be "$(id -ru)"): > if test "x$UID" = "x"; then false positive, since we set it at that time. > possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 31 > (type): > if type xdg-user-dirs-update >/dev/null 2>&1; then not sure how to fix that :/ > possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 36 > (should be '.', not 'source'): > source "$XDG_CONFIG_HOME/user-dirs.dirs" > possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 91 > ($UID should be "$(id -ru)"): we already set it before, so false positive > if test $UID -gt 0 -a -z "$VNCSESSION"; then > possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 168 > (type): > type "$trycmd" >/dev/null 2>&1 || continue again, not sure how to fix it. > possible bashism in debian/xfce/desktop/xfce-utils/scripts/xinitrc.in line 172 > (type): > if test "$cmd" && type "$cmd" >/dev/null 2>&1; then and again. So all in all, the only fixable one is the source / . which is fairly easy to do. I'll check how to fix the “type” one. For the export= stuff, it's not detected by checkbashism, so I *guess* it's something POSIX and thus sould be kept? (but if it fixes other problems, why not). Cheers,
Hmhm, seems that “type” should be replaced by “which” so here's my diff: diff --git a/scripts/xinitrc.in b/scripts/xinitrc.in index e19dbe1..7358162 100755 --- a/scripts/xinitrc.in +++ b/scripts/xinitrc.in @@ -28,12 +28,12 @@ fi # set up XDG user directores. see # http://freedesktop.org/wiki/Software/xdg-user-dirs -if type xdg-user-dirs-update >/dev/null 2>&1; then +if which xdg-user-dirs-update >/dev/null 2>&1; then xdg-user-dirs-update fi if test -f "$XDG_CONFIG_HOME/user-dirs.dirs"; then - source "$XDG_CONFIG_HOME/user-dirs.dirs" + . "$XDG_CONFIG_HOME/user-dirs.dirs" # i'm deliberately not 'export'-ing the XDG_ vars, because you shouldn't # rely on the env vars inside apps, since the file could be changed at # any time by the user. this is solely here for migration purposes. @@ -165,11 +165,11 @@ if test -d "$XDG_CONFIG_HOME/autostart"; then # check for TryExec trycmd=`grep -E "^TryExec=" "$i" | cut -d'=' -f2` if test "$trycmd"; then - type "$trycmd" >/dev/null 2>&1 || continue + which "$trycmd" >/dev/null 2>&1 || continue fi cmd=`grep -E "^Exec=" "$i" | cut -d'=' -f2` - if test "$cmd" && type "$cmd" >/dev/null 2>&1; then + if test "$cmd" && which "$cmd" >/dev/null 2>&1; then $cmd & fi done
Patch is fine with me.
(The 'source' line is already fixed in svn.)
I saw 2~ patches applied to startxfce4/xinitrc, could someone have a look at bug 5382 please?
Fixed the type -> which replacements in master. Maybe someone can check for more bash-isms once this is pushed?
Can anyone running Open Solaris check whether the current startxfce4 from git master branch works?
(In reply to comment #12) > Can anyone running Open Solaris check whether the current startxfce4 from git > master branch works? Works just fine for me, on Solaris, thanks. (OpenSolaris shouldn't be a problem as it doesn't have such a horribly antiquated /bin/sh so never suffered from the original problem.)
Marking as fixed then, thanks for the feedback.