Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 504140

Summary: sys-apps/openrc: Please take /etc/X11/startDM.sh from x11-apps/xinit
Product: Gentoo Linux Reporter: Kirill Elagin <kirelagin>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED FIXED    
Severity: normal CC: arthur, bitlord0xff, kirelagin, openrc, pastas4, polynomial-c, schiffsratte, wizardedit
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 504116    
Attachments: startDM.sh-patch
use /lib/gentoo/functions.sh instead of /etc/init.d/functions.sh

Description Kirill Elagin 2014-03-10 21:00:38 UTC
See bug 504116.
Comment 1 William Hubbs gentoo-dev 2014-03-13 13:49:51 UTC
I just looked this over, and the sourcing of /etc/init.d/functions.sh
appears to be correct, because startDM.sh is calling start-stop-daemon.
However, that means startDM.sh will not work if OpenRc is removed from
the system.

Is that how it is supposed to work?

William
Comment 2 Kirill Elagin 2014-03-13 21:55:59 UTC
You are right, this file is OpenRC-related and depends on it.
Actually, I wonder, why is it installed as part of `x11-apps/xinit` (and not as part of OpenRC) as it is used only by /etc/init.d/xdm. Actually, the only place where this file is referenced is /etc/inittab. I'll ignore the fact that this looks like an ugly hack to me, but this strengthens my suspicious that it should be moved to OpenRC.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-11-25 09:17:27 UTC
Reopening as this prevents removal of /etc/init.d/functions.sh forver.

Please consider to relocate the /etc/X11/startDM.sh script from x11-apps/xinit package to sys-apps/openrc as it's only ever getting called by /etc/init.d/xdm script (which belongs to x11-base/xorg-server). Adding it to the xorg-server package makes no sense as that would not fix the requirement of having some functions.sh script.
Comment 4 SpanKY gentoo-dev 2016-12-01 06:55:36 UTC
i'm not following the logic here.  this script doesn't make sense in openrc.  the fact that it uses functions.sh is irrelevant -- functions.sh is a stable part of the Gentoo distro.  no one has requested every other project using functions.sh be merged into openrc.

if it's only used by/for xdm, them move it to xdm ?

either way, changing the file startDM.sh sources is irrelevant to the package that owns it.  it's trivial to update/bump xinit to use a diff path like any other package.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-12-01 06:59:41 UTC
(In reply to SpanKY from comment #4)
> i'm not following the logic here.  this script doesn't make sense in openrc.
> the fact that it uses functions.sh is irrelevant -- functions.sh is a stable
> part of the Gentoo distro.  no one has requested every other project using
> functions.sh be merged into openrc.
> 
> if it's only used by/for xdm, them move it to xdm ?
> 
> either way, changing the file startDM.sh sources is irrelevant to the
> package that owns it.  it's trivial to update/bump xinit to use a diff path
> like any other package.

Fair enough. But currently the xinit package contains a script that is sourcing /etc/init.d/functions.sh which we all agreed that it should be removed.
So some action is necessary here and I just want to make sure that action will be done.
Comment 6 Jens 2017-04-02 13:13:05 UTC
Created attachment 468998 [details, diff]
startDM.sh-patch
Comment 7 Jens 2017-04-02 13:13:38 UTC
Why not simply bail out on non openerc systems ?
Comment 8 Austin English (RETIRED) gentoo-dev 2017-10-18 21:42:54 UTC
Created attachment 499166 [details, diff]
use /lib/gentoo/functions.sh instead of /etc/init.d/functions.sh

This patch actually changes the sourced functions, as well as errors out if the script is called on a non-OpenRC system.

@x11, could someone please review?
Comment 9 Austin English (RETIRED) gentoo-dev 2017-10-18 21:58:52 UTC
(In reply to Austin English from comment #8)
> Created attachment 499166 [details, diff] [details, diff]
> use /lib/gentoo/functions.sh instead of /etc/init.d/functions.sh
> 
> This patch actually changes the sourced functions, as well as errors out if
> the script is called on a non-OpenRC system.
> 
> @x11, could someone please review?

Got the ack from mrueg on IRC, so committed:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bb6b9e50bdb8efc9a4627e60a4e63d38e8d6255

I'll leave it to @x11 to version bump/stabilize.

AFAICT, with this commit, bug 504116 should be complete (once xinit and netqmail are stabilized).
Comment 10 Branko Grubic 2017-10-19 06:30:28 UTC
It seems that these changes break startDM.sh see bug #634706
Comment 11 Matt Turner gentoo-dev 2017-10-19 16:10:11 UTC
Reverted, as it seems it was completely untested and caused bug 634706.
Comment 12 Dainius Masiliƫnas 2017-12-10 17:46:05 UTC
So what's the roadmap for this now? Are the functions used by startDM.sh missing in gentoo-functions and still need to ported, or is it just a naming problem, or..?
Comment 13 William Hubbs gentoo-dev 2017-12-13 17:39:53 UTC
All,

is there a way to force X to pick a specific vt when it starts instead of
the next available vt?
Comment 14 William Hubbs gentoo-dev 2019-03-04 02:24:40 UTC
After looking into this, the issue is described pretty well in the note
at the top of /etc/init.d/xdm.

I still need the answer to my question in the previous comment. Is there
a way to tell the dm to start on a specific tty?
If I can do that, I can just force the dm to always start on tty7.

Thanks,

William
Comment 15 Larry the Git Cow gentoo-dev 2019-05-15 18:51:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=244cc8e97a0e43856f503046359b8bd8372dc34b

commit 244cc8e97a0e43856f503046359b8bd8372dc34b
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2019-05-15 18:39:18 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2019-05-15 18:51:15 +0000

    x11-apps/xinit: Don't use deprecated /etc/init.d/functions.sh
    
    Closes: https://bugs.gentoo.org/504140
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 x11-apps/xinit/files/startDM.sh      |  9 +++++++--
 x11-apps/xinit/files/startDM.sh.1    | 30 ++++++++++++++++++++++++++++++
 x11-apps/xinit/xinit-1.4.0-r1.ebuild |  2 +-
 3 files changed, 38 insertions(+), 3 deletions(-)
Comment 16 Arfrever Frehtes Taifersar Arahesis 2019-05-17 00:55:00 UTC
(In reply to William Hubbs from comment #14)
> Is there a way to tell the dm to start on a specific tty?

User can configure where X server is started.

- When using SDDM:
  In /etc/sddm.conf.d/${something}.conf or /etc/sddm.conf:
    [X11]
    MinimumVT=${number}

- When using startx:
  Permanent configuration:
    ${HOME}/.xserverrc or /etc/X11/xinit/xserverrc (first existing one is used)

  One-time overriding:
    startx -- vt${number}
      (${HOME}/.xserverrc and /etc/X11/xinit/xserverrc are fully ignored when server arguments are specified.)

    XDG_VTNR=${number} startx