Every time I try to stop slim with #/etc/init.d/xdm stop, it fails. I have to manually kill X and slim to really stop it. But this leaves a stale lockfile... There is the same problem when shutting down the system from console by any means. There is no problem when shutting down via slims special user "halt". Reproducible: Always Steps to Reproduce: 1. /etc/init.d/xdm stop -> fails 2. killall X; killall -9 slim 3. /etc/init.d/xdm stop -> now works Expected Results: /etc/init.d/xdm stop runs without failure. Portage 2.2_rc23 (default/linux/x86/2008.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.28-tuxonice-r3 i686) ================================================================= System uname: Linux-2.6.28-tuxonice-r3-i686-Intel-R-_Core-TM-_Duo_CPU_T2300_@_1.66GHz-with-glibc2.0 Timestamp of tree: Wed, 04 Mar 2009 22:45:02 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p48-r1 dev-java/java-config: 2.1.7 dev-lang/python: 2.5.4-r2 dev-python/pycrypto: 2.0.1-r7 dev-util/ccache: 2.4-r8 dev-util/cmake: 2.6.2-r1 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.4.3-r1 sys-apps/sandbox: 1.3.8 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.19.1 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6a virtual/os-headers: 2.6.28-r1 ACCEPT_KEYWORDS="x86 ~x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="ccache distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://mirror.netcologne.de/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://de-mirror.org/distro/gentoo/ http://mirror.cambrium.nl/pub/os/linux/gentoo/ http://mirror.muntinternet.net/pub/gentoo/" LANG="de_DE" LC_ALL="de_DE" LDFLAGS="-Wl,-O1" LINGUAS="de fr nl en en_GB en_US" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/swegener /usr/portage/local/local-overlay" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="7zip X a52 aac abook ace acl acpi alsa applet audacious audiofile bash-completion battery berkdb bluetooth branding bzip2 cairo caps cdda cddb cdparanoia cdr cgi chipcard cli compress context cpio cpufreq cracklib crypt cups curl cursors dbus device-mapper dga directfb divx djvu doc dri dv dvd dvdr dvdread dvi emacs emboss emerald encode epydoc examples exif expat extra fam fastcgi fat fbcon fbcondecor fbsplash ffmpeg flac fontconfig fortran ftp fuse gcj gd gdbm gdm gedit gif gimp glib glitz gmedia gnutls gpgme gpm grace graphics graphviz gs gtk gzip hal hbci hdaps hddtemp http humanities hybrid-auth ibmacpi icecast icons iconv icq icu id3 id3tag imagemagick imap imlib imlib2 iproute2 ipv6 ipw3945 irc isdnlog jabber java java6 javascript jpeg kerberos kpathsea ladspa lame laptop latex lcms ldap libnotify libsamplerate libwww lm_sensors logrotate logwatch lua mad midi mikmod milter mime mjpeg mmx mmxext mng motif mp3 mpeg mplayer mudflap musepack musicbrainz nano-syntax ncurses network-cron nls nntp nptl nptlonly nsplugin ntfs ntp obex offensive ofx ogg omega opengl openmp oscar pam pcmcia pcre pda pdf perl php pmu png pop posix postgres ppds pppd prediction print pstricks publishers python qt3 qt3support qt4 quicktime quotes rar rdesktop readline realmedia reflection replaygain replytolist resolvconf rpm rss samba sasl science sdl session skey slang slit smapi smime smp snmp sockets socks5 sound soundtouch speex spell spl sqlite sqlite3 sse sse2 ssh ssl startup-notification subtitles subversion svg swig sysfs syslog sysvipc t1lib taglib tcpd tetex tex4ht theora threads tiff toolbar tools transcode trayicon truetype twolame unicode unzip usb utils uuencode v4l v4l2 vamp vcd vhosts video vnc vncviewer vorbis wavpack wifi win32codecs wireshark wma wmf wmp x86 xattr xcb xcomposite xetex xface xfce xft xine xinerama xinetd xml xorg xosd xpm xscreensaver xskatcards xspf xulrunner xv xvid yv12 zip zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" CAMERAS="canon ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de fr nl en en_GB en_US" USERLAND="GNU" VIDEO_CARDS="vesa intel v4l vga i810" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Try /etc/init.d/xdm zap after you killed X manually. Of course this is only some "workaround" until there's found some better solution. Reassigning to slim maintainer, CCing desktop-misc herd, CCing x11 herd as well as xdm init script belongs to x11-apps/xinit package.
Probably related to bug 186886. I can't reliably reproduce this issue either. =/
OK, since I can reproduce it easily: I will dig into it later on. Any more informations that I can provide which might help on finding the causes of this?
In the log file this message shows up, when using the xdm init script to stop: (BTW: why does slim log all X messages, too?) slim: unexpected signal 15 I did an strace and after the first try to stop it, nothing more happens at the strace strace log follows: Process 12001 attached - interrupt to quit select(5, [4], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted) --- SIGALRM (Alarm clock) @ 0 (0) --- waitpid(12005, NULL, WNOHANG) = 0 rt_sigaction(SIGALRM, {0x8068280, [ALRM], SA_RESTART}, {0x8068280, [ALRM], SA_RESTART}, 8) = 0 alarm(2) = 0 sigreturn() = ? (mask now []) select(5, [4], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted) --- SIGALRM (Alarm clock) @ 0 (0) --- waitpid(12005, NULL, WNOHANG) = 0 rt_sigaction(SIGALRM, {0x8068280, [ALRM], SA_RESTART}, {0x8068280, [ALRM], SA_RESTART}, 8) = 0 alarm(2) = 0 sigreturn() = ? (mask now []) select(5, [4], [], NULL, NULL) = ? ERESTARTNOHAND (To be restarted) --- SIGTERM (Terminated) @ 0 (0) --- write(2, "slim"..., 4) = 4 write(2, ": unexpected signal "..., 20) = 20 write(2, "15"..., 2) = 2 write(2, "\n"..., 1) = 1 alarm(0) = 1 rt_sigaction(SIGQUIT, {0x1, [QUIT], SA_RESTART}, {0x8068300, [QUIT], SA_RESTART}, 8) = 0 rt_sigaction(SIGINT, {0x1, [INT], SA_RESTART}, {0x8068300, [INT], SA_RESTART}, 8) = 0 rt_sigaction(SIGHUP, {0x1, [HUP], SA_RESTART}, {0x8068300, [HUP], SA_RESTART}, 8) = 0 rt_sigaction(SIGPIPE, {0x1, [PIPE], SA_RESTART}, {0x8068300, [PIPE], SA_RESTART}, 8) = 0 rt_sigaction(SIGTERM, {SIG_DFL, [TERM], SA_RESTART}, {0x8068300, [TERM], SA_RESTART}, 8) = 0 rt_sigaction(SIGKILL, {SIG_DFL, [KILL], SA_RESTART}, {0x8068300, [TERM], SA_RESTART}, 8) = -1 EINVAL (Invalid argument) rt_sigaction(SIGALRM, {SIG_DFL, [ALRM], SA_RESTART}, {0x8068280, [ALRM], SA_RESTART}, 8) = 0 select(5, [4], [4], NULL, NULL) = 1 (out [4]) writev(4, [{"<\0\2\0\0\0@\0+\0\1\0"..., 12}], 1) = 12 +++ killed by SIGKILL +++
thx, I'm not sure what this tells me but I should be able to revisit it sometime.
*** Bug 261682 has been marked as a duplicate of this bug. ***
I can't even start slim. Though DISPLAYMANAGER in /etc/conf.d/xdm is set to "slim", the script always tries to execute xdm and not slim. :/
I think the code from /etc/init.d/xdm lines 92-99 fails hard. I work around the problem by changing EXE= to /usr/bin/slim in the init.d file
Created attachment 206465 [details, diff] Don't catch SIGKILL (doesn't fix the bug, though) (In reply to comment #4) > rt_sigaction(SIGKILL, {SIG_DFL, [KILL], SA_RESTART}, {0x8068300, [TERM], > SA_RESTART}, 8) = -1 EINVAL It shouldn't even try to catch SIGKILL. The patch should fix that, but doesn't fix the bug.
From some rambling found on a Madriva bug report, I discovered that if one manually kills the X session, then /etc/init.d/xdm will successfully shutdown slim. This is almost certainly an upstream problem, but they have "high priority" bugs on their bug tracker that are over a year old: http://developer.berlios.de/bugs/?group_id=2663 So I doubt anything will be fixed anytime soon. Any suggestions for another lightweight login manager?
Orthos, in sunrise :]
Debian bug - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501828 Upstream bug: http://developer.berlios.de/bugs/?func=detailbug&bug_id=15326&group_id=2663 No solution yet. :/
I did some testing on this bug and I could narrow it down a little. Stoping slim fails when calling XCloseDisplay(Dpy); Calling XCloseDisplay(Dpy); never returns and slim uses up all the CPU, never coming to an and. As a quick and dirty hack it helps to comment-out XCloseDisplay(Dpy); in the StopServer Routine. But it's not a fix, it just lets slim come to an end. I didn't have time yet to dig deeper to find out where it hangs when calling XCloseDisplay(Dpy);
Created attachment 224675 [details] remove the hanging XCloseDisplay() --not a proper fix This is the patch I used to do the above -- as mentioned previously, it works because slim completes its shutdown call now, but it's still not a proper fix.
(In reply to comment #14) > This is the patch I used to do the above -- as mentioned previously, it works > because slim completes its shutdown call now, but it's still not a proper fix. Thanks. Will try, kill -9 is not a proper fix either, so can't be worse *g*
I can stop xdm without errors if I had logged in using slim. If I try to stop it before logging in I get blocking call to XCloseDisplay() which was called from: CatchSignal() -> App::StopServer() -> XCloseDisplay() I tried to track this problem and I've found why XCloseDisplay() blocks. Here is call stack for the moment of time when slim waits for input: App::Run() -> App::AuthenticateUser() -> PAM::Authenticator::authenticate() -> pam_authenticate() -> ... -> conv() -> Panel::EventHandler() -> XNextEvent() XNextEvent() is actually blocking function waiting for input. XCloseDisplay() is called in the middle of XNextEvent() call which is terribly wrong. So we should somehow gracefully terminate XNextEvent() from signal handler and only after that call App::StopServer()
Created attachment 232517 [details, diff] Never block in XNextEvent() function
I have added patch which should fix this problem. It works fine for me. Please test. This patch makes slim never call XNextEvent() if there is no event in queue. So XCloseDisplay() can be called from signal handler.
(In reply to comment #18) > I have added patch which should fix this problem. It works fine for me. Please > test. > This patch makes slim never call XNextEvent() if there is no event in queue. So > XCloseDisplay() can be called from signal handler. > I can verify this patch worked for me as well. Using: slim 1.3.2 xorg-server-1.7.6 gentoo-sources-2.6.35-r1 ati-drivers-10.7 perhaps the maintainer could add this to portage?
I thought the problem was that slim has /var/run/slim.{auth,lock} and /etc/init.d/xdm expects /var/run/slim.pid ..
(In reply to comment #20) > I thought the problem was that slim has /var/run/slim.{auth,lock} and > /etc/init.d/xdm expects /var/run/slim.pid .. > So do I. I use a slightly modified init.d/xdm: @@ -71,6 +70,10 @@ EXE="/usr/kde/${MY_XDM#kdm-}/bin/kdm" PIDFILE=/var/run/kdm.pid ;; + slim) + EXE="$(which slim)" + PIDFILE=/var/run/slim.lock + ;; entrance*) EXE=/usr/sbin/entranced PIDFILE=/var/lib/entranced.pid
The patch in Attachment 323517 fixed the problem on my system as well.. (slim-1.3.2 on x86) I have a similar entry in my /etc/init.d/xdm , although instead of $(which slim) I just have /usr/bin/slim
(In reply to comment #17) > Created an attachment (id=232517) [details] > Never block in XNextEvent() function > Will someone post this patch upstream?
(In reply to comment #23) > (In reply to comment #17) > > Created an attachment (id=232517) [details] [details] > > Never block in XNextEvent() function > > > > Will someone post this patch upstream? > Upstream already has the bug listed at http://developer.berlios.de/bugs/?func=detailbug&bug_id=15326&group_id=2663 -- i just added a comment to it pointing to this discussion as well as the patch.
Thanks all. Please file new bug reports in lieu of re-opening this one. +*slim-1.3.2-r1 (24 Aug 2010) + + 24 Aug 2010; Jeremy Olexa <darkside@gentoo.org> + +files/261359-fix-SIGTERM-freeze.patch, +slim-1.3.2-r1.ebuild, + +files/slim-1.3.2-r1-config.diff: + Revision bump which should improve shutdown behavior by patching a SIGTERM + issue and changing the pid file to slim.pid instead of slim.lock. Thanks + to Grygoriy I. Fuchedzhy and others in bug 261359
Sorry, forgot to mention that /etc/init.d/xdm should work without manual patching now as long as DISPLAYMANAGER=slim in /etc/conf.d/xdm
(In reply to comment #21) > (In reply to comment #20) > > I thought the problem was that slim has /var/run/slim.{auth,lock} and > > /etc/init.d/xdm expects /var/run/slim.pid .. > > > > So do I. I use a slightly modified init.d/xdm: I realized that it should not be necessary to modify the init script as slim.conf has an appropriate directive whose value just need to be gentoo-ified: ------------------------------------------- # Lock file #lockfile /var/run/slim.lock lockfile /var/run/slim.pid -------------------------------------------