You are not logged in.

#1 2017-07-17 14:05:28

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,631

unable to specify a custom xorg.conf to xinit.

The following ignores my custom xorg configuration file, i can't understand why.

This is what i run:

#!/bin/bash
vt=vt1
display=:1

SCRIPTDIR=${0%/*}
cd $SCRIPTDIR

xinit ./xgame.single_head.xinitrc -- \
/usr/bin/X "$display" "$vt" \
-config xgame.single_head.xorg.conf

when i start it, i get:

koko@Gozer# date
lun 17 lug 2017, 16.01.49, CEST

koko@Gozer# ls -la /var/log/Xorg.1.log 
-rw-r--r-- 1 root koko 24293 lug 17 15:59 /var/log/Xorg.1.log

koko@Gozer# grep EE /var/log/Xorg.1.log
[526308.995] Current Operating System: Linux Gozer 4.9.5-1-ARCH #1 SMP PREEMPT Fri Jan 20 12:11:50 CET 2017 x86_64
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[526308.996] (EE) Unable to locate/open config file: "xgame.single_head.xorg.conf"
[526309.001] (EE) Failed to load module "nv" (module does not exist, 0)
[526309.001] (EE) Failed to load module "fbdev" (module does not exist, 0)

So i ran my script through strace, and see:

koko@Gozer# grep xgame.single_head.xorg.conf /tmp/out.log 
execve("/usr/bin/xinit", ["xinit", "xgame.single_head.xinitrc", "--", "/usr/bin/X", ":1", "vt1", "-config", "xgame.single_head.xorg.conf"], 0x7ffc192c4d90 /* 81 vars */) = 0
[pid  8867] execve("/usr/bin/X", ["/usr/bin/X", ":1", "vt1", "-config", "xgame.single_head.xorg.conf"], 0x7ffcf1ef3300 /* 81 vars */) = 0
[pid  8867] execve("/usr/lib/xorg-server/Xorg.wrap", ["/usr/lib/xorg-server/Xorg.wrap", ":1", "vt1", "-config", "xgame.single_head.xorg.conf"], 0x2101040 /* 78 vars */) = 0
[pid  8867] execve("/usr/lib/xorg-server/Xorg", ["/usr/lib/xorg-server/Xorg", ":1", "vt1", "-config", "xgame.single_head.xorg.conf"], 0x7ffeac85acf8 /* 77 vars */) = 0
[pid  8867] open("xgame.single_head.xorg.conf", O_RDONLY) = 17
[pid  8867] write(2, "(++) Using config file: \"xgame.s"..., 54(++) Using config file: "xgame.single_head.xorg.conf"

open("xgame.single_head.xorg.conf", O_RDONLY) = 17 means it found the file.

Now i'm a bit puzzled on why xorg says it cannot open/locate the config file, and strace says it opened it (??)

If useful, here it is:

koko@Gozer# cat xgame.single_head.xorg.conf 
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 381.22  (builduser@anthraxx)  Mon May 22 13:41:42 CEST 2017

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Samsung SyncMaster"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 750 Ti"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "DVI-D-1: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Any idea?

-EDIT-
OK, man 5 xorg.conf revealed that the relative path for the configuration file is to /etc/X11 and some other system paths.
So:
* is it not possible for an unprivileged user to use a custom xorg configuration without havig root rights to change system files ?
* why strace output says it opened the file?

Last edited by kokoko3k (2017-07-17 14:12:41)

Offline

#2 2017-07-18 11:51:50

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 5,366

Re: unable to specify a custom xorg.conf to xinit.

Unless you give the user rights on those files (plenty of options for that) , root will have to create / change them.
Once the files have been setup, the user only needs read rights on the custom xorg.conf file .

no idea about strace.


Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

Board footer

Powered by FluxBB