Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 553446 - gnome-base/gdm- does not execute scripts in /etc/gdm/Init
Summary: gnome-base/gdm- does not execute scripts in /etc/gdm/Init
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
Depends on:
Reported: 2015-06-27 22:14 UTC by bwcknr
Modified: 2015-12-20 08:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

startup of gdm.service with debug logging enabled (gdm-,13.67 KB, text/plain)
2015-06-27 22:20 UTC, bwcknr
script to be run from /etc/gdm/Init/Default (Default,2.63 KB, text/plain)
2015-06-27 22:54 UTC, bwcknr

Note You need to log in before you can comment on or make changes to this bug.
Description bwcknr 2015-06-27 22:14:35 UTC
Running gdm- with xorg-server-1.17.1-r1 and systemd-220-r2 does not execute initialization scripts as documented in various locations

Reproducible: Always

Steps to Reproduce:
1. emerge gnome with gdm
2. enable gdm.service
3. start gdm.service
Actual Results:  
Upon startup scripts in /etc/gdm/Init are not executed

Expected Results:  
As documented in and Default of DISPLAY script should be executed

emerge --info
Portage 2.2.20 (python 3.3.5-final-0, default/linux/amd64/13.0/desktop/gnome/systemd, gcc-4.9.2, glibc-2.20-r2, 4.0.5-gentoo x86_64)
System uname: Linux-4.0.5-gentoo-x86_64-Intel-R-_Core-TM-_i7-3630QM_CPU_@_2.40GHz-with-gentoo-2.2
KiB Mem:    16226640 total,  10413448 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 27 Jun 2015 21:30:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25 p1.2) 2.25
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo
dev-util/cmake:           3.2.3::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25-r1::gentoo
sys-devel/gcc:            4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000

ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.3/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 aac acl acpi aes alsa amd64 avx berkdb bluetooth branding bzip2 cairo cdda cdr cli colord cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam ffmpeg firefox flac fortran gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv introspection ipv6 jpeg lcms libnotify libsecret mad mmx mmxext mng modules mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf png policykit popcnt ppds pulseaudio readline sdl session spell sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xinerama xml xv xvid zlib" ABI_X86="32 64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby20 ruby22" USERLAND="GNU" VIDEO_CARDS="intel i965 nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 1 bwcknr 2015-06-27 22:20:55 UTC
Created attachment 405876 [details]
startup of gdm.service with debug logging enabled
Comment 2 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-06-27 22:49:27 UTC
Please attach the script that you wanted to run, and "ls -l" output showing where it is installed with what name/mode.
Comment 3 bwcknr 2015-06-27 22:54:10 UTC
Created attachment 405880 [details]
script to be run from /etc/gdm/Init/Default

ls -lah /etc/gdm/Init/Default
-rwxr-xr-x 1 root root 2,7K 28. Jun 00:03 /etc/gdm/Init/Default
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-06-27 23:25:15 UTC
(In reply to bwcknr from comment #3)
> Created attachment 405880 [details]
> script to be run from /etc/gdm/Init/Default
> ls -lah /etc/gdm/Init/Default
> -rwxr-xr-x 1 root root 2,7K 28. Jun 00:03 /etc/gdm/Init/Default

Thanks. There are two things going wrong here:

1) In general, Init/Default script seems to be ignored. (But PostLogin/Default and PreLogin/Default do run.)

2) Your Init/Default would fail even if gdm did not ignore it.

Remember that "exec" means replace the current shell interpreter process with the specified command. So everything in the script file after "exec xrandr --setprovideroutputsource ..." will not run. Including the "xrandr --auto" that you probably need for optimus.

The user who added those instructions in the wiki doesn't know shell syntax, we need to fix the page. It's a problem with wikis, people will sometimes add nonsense and since it's hosted on it looks official...
Comment 5 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-06-28 00:26:45 UTC
Reported upstream at
Comment 6 Guillaume LE VAILLANT 2015-10-29 15:03:47 UTC
Here's a workaround to execute the xrandr commands required during gdm initialization to make it work with optimus.

Create the file "/usr//share/gdm/greeter/autostart/optimus.desktop" containing:

[Desktop Entry]
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"

With this gdm starts and you can enter your login/password, but after you hit enter you only get a black screen. There's another file to add to fix this.

Create the file "/etc/X11/xinit/xinitrc.d/01-optimus" containing:

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

Set this file executable:

chmod +x /etc/X11/xinit/xinitrc.d/01-optimus

With these two files I'm able to login successfully with gdm on my optimus system.
Comment 7 bwcknr 2015-12-20 08:11:14 UTC
Finally found time to evaluate the configuration and for me it's working.

Upstream confirmed that scripts are documented and distributed, but are not effectively run.

Furthermore there is planned to be support in Xserver for automatically configuration of Optimus systems.