In /etc/X11/startDM.sh: . /etc/init.d/functions.sh But /etc/X11/startDM.sh has "#!/bin/sh", so this fails when /bin/sh does not point to bash. Now, I do not understand completely when the x: line in the default /etc/inittab gets invoked and when it doesn't, but this can't be good when it does.
(In reply to comment #0) > In /etc/X11/startDM.sh: > > . /etc/init.d/functions.sh > > But /etc/X11/startDM.sh has "#!/bin/sh", so this fails when /bin/sh does not > point to bash. I'm afraid to try it, but I think that pointing /bin/sh to something other than bash might break lots of other things too. > Now, I do not understand completely when the x: line in the default > /etc/inittab gets invoked and when it doesn't, but this can't be good when it > does. It gets invoked when /etc/init.d/xdm runs `telinit a`. It works well as long as /bin/sh points to bash. Gentoo makes fairly heavy use of bash. Most Gentoo systems have /bin/sh as a symlink to /bin/bash. The idea of being shell neutral is good sometimes, but not necessarily here. Everything is designed to work with bash. Bash has some nice features that other shells don't have.
> I'm afraid to try it, but I think that pointing /bin/sh to something other than bash might break lots of other things too. It doesn't. Search for "dash" on this bugzilla, there are just a couple of problems (mainly during build time, not deployment) that are worked out. > The idea of being shell neutral is good sometimes, but not necessarily here. > Everything is designed to work with bash. Bash has some nice features that > other shells don't have. Your assumptions are incorrect. Gentoo uses #!/bin/bash when necessary.
(In reply to comment #2) > > I'm afraid to try it, but I think that pointing /bin/sh to something other than bash might break lots of other things too. > > It doesn't. Search for "dash" on this bugzilla, there are just a couple of > problems (mainly during build time, not deployment) that are worked out. Oh, cool. I've heard of dash but never tried it. > > The idea of being shell neutral is good sometimes, but not necessarily here. > > Everything is designed to work with bash. Bash has some nice features that > > other shells don't have. > > Your assumptions are incorrect. Gentoo uses #!/bin/bash when necessary. > I think you may be right. I was presuming that almost all Gentoo users used bash. Not necessarily as their user shell, but certainly as their /bin/sh symlink. I'm going to try dash.
(In reply to comment #3) > I'm going to try dash. I just tried dash and it seems to support '.' (but not its alias 'source'). So . /etc/init.d/functions.sh works in dash.
I was using version 0.5.5.1.7.
The problem is not with . vs source, the problem is that /etc/init.d/functions.sh needs bash. If /etc/init.d/functions.sh is necessary, then /etc/X11/startDM.sh should really have the #!/bin/bash shebang. Whether functions.sh are really necessary for startDM.sh, I don't know.
(In reply to comment #6) > The problem is not with . vs source, the problem is that > /etc/init.d/functions.sh needs bash. If /etc/init.d/functions.sh is necessary, > then /etc/X11/startDM.sh should really have the #!/bin/bash shebang. Whether > functions.sh are really necessary for startDM.sh, I don't know. > For me, dash has no trouble with /etc/init.d/functions.sh. I can do this: chris@prism ~ $ dash $ . /etc/init.d/functions.sh $ echo $RC_GOT_FUNCTIONS yes $ rc_runlevel default
Maybe it's because you are using baselayout-2? For me (dash 0.5.5.1.2, baselayout 1.12.13): # . /sbin/functions.sh /sbin/functions.sh: 7: [[: not found /sbin/functions.sh: 10: declare: not found /sbin/functions.sh: 11: declare: not found /sbin/functions.sh: 87: [[: not found /sbin/functions.sh: 87: [[: not found /sbin/functions.sh: 96: [[: not found /sbin/functions.sh: 104: [[: not found /sbin/functions.sh: 706: Syntax error: Bad for loop variable
(In reply to comment #8) > Maybe it's because you are using baselayout-2? > > For me (dash 0.5.5.1.2, baselayout 1.12.13): > > # . /sbin/functions.sh > /sbin/functions.sh: 7: [[: not found > /sbin/functions.sh: 10: declare: not found > /sbin/functions.sh: 11: declare: not found > /sbin/functions.sh: 87: [[: not found > /sbin/functions.sh: 87: [[: not found > /sbin/functions.sh: 96: [[: not found > /sbin/functions.sh: 104: [[: not found > /sbin/functions.sh: 706: Syntax error: Bad for loop variable > I am running baselayout-2. My system is ~amd64. Bug reports here on Gentoo are usually presumed to be from ~arch users. Dash support is, I guess, a feature that hasn't trickled down to stable yet. But be patient. Or switch to ~arch. I recommend that you switch to ~arch.
Frankly, in 6 years of using Gentoo I never had an issue with reporting bugs in stable packages.
(In reply to comment #10) > Frankly, in 6 years of using Gentoo I never had an issue with reporting bugs in > stable packages. That's good. I've been using Gentoo since 2004 too. But I have had some issues reporting bugs in stable packages. See bug #338137. I went mad over that one. I wish I had never reported it.
Sometimes bugs are fixed in ~arch, but then those changes have to go without bug reports for 30 days before they make it into stable arch.
This bug is sadly fixed by using openrc/baselayout-2. It indeed is broken with baselayout-1. I would recommend proding on the stablebug for baselayout-2 to tell them to finally stabilise it... (nothing for us to fix, works in ~)