SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-09-25 05:22:31

shazbot
Member
From: Boston, USA
Registered: 2010-05-14
Posts: 32
Website

Problems running GDM-free: wireless, logout problems

Recently I decided to get rid of GDM because I only ever use Openbox on X and most of the time I work completely from the console, so it's a waste for X to stay running when I don't use it. I'd rather "opt-in" to an X session with startx than "opt-out" and have it continue using resources in the background.

I uninstalled GDM and added "exec openbox-session" to my .xinitrc file. Now startx pushes me into Openbox correctly, but whereas usually (with GDM) nm-applet connects me to my wireless network automatically when I log in, without GDM I have no such luck. I have to manually enter my WPA key every time, which is a pain because it's very long (untrustworthy neighbors).

I remember 3 or so years ago in Ubuntu with GNOME, I faced a similar problem that was due to GDM not correctly unlocking the GNOME keyring when I logged in. Is this the same issue? Is there something I could add to my .xinitrc that would prevent nm-applet from prompting me for my password every time?

Secondly, Crunchbang's default logout script depended on GDM and thus was also uninstalled. I reverted my menu.xml file to what I thought was the standard logout menu item for Openbox. It looks like this:

        <item label="Exit">
            <action name="Exit">
                          <prompt>yes</prompt>
            </action>
        </item>

It drops me out of X correctly, but there is a graphical problem with the exit dialog:
logout-dialog.png

Can I tweak that for readability? And what concerns me more is, when I'm dropped back into the command line after I exit Openbox, I get this error:

waiting for X server to shut down XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
 after 17698 requests (17698 known processed) with 0 events remaining. 
[12147:12147:3498526218:FATAL:app/x11_util.cc(64)] X IO Error detected

Is there something wrong with my X server that can be corrected? If the error message is actually of no concern, is there a way to suppress it?

I realize that's a lot of questions all at once, but they all seem to be spurred from this one change and I didn't feel right barraging everyone with posts by splitting them into separate topics. I'd greatly appreciate any advice you could give me.

Last edited by shazbot (2010-09-25 05:25:09)

Offline

Help fund CrunchBang, donate to the project!

#2 2010-09-25 05:51:10

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,418

Re: Problems running GDM-free: wireless, logout problems

You can use this script for shutdown/reboot/logout:

#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import gtk
import os

class DoTheLogOut:

    # Cancel/exit
    def delete_event(self, widget, event, data=None):
        gtk.main_quit()
        return False

    # Logout
    def logout(self, widget):
        os.system("openbox --exit")

    # Reboot
    def reboot(self, widget):
        os.system("sudo shutdown -r now")

    # Shutdown
    def shutdown(self, widget):
        os.system("sudo shutdown -h now")

    def __init__(self):
        # Create a new window
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_title("Exit? Choose an option:")
        self.window.set_resizable(False)
        self.window.set_position(1)
        self.window.connect("delete_event", self.delete_event)
        self.window.set_border_width(20)

        # Create a box to pack widgets into
        self.box1 = gtk.HBox(False, 0)
        self.window.add(self.box1)

        # Create cancel button
        self.button1 = gtk.Button("Cancel")
        self.button1.set_border_width(10)
        self.button1.connect("clicked", self.delete_event, "Changed me mind :)")
        self.box1.pack_start(self.button1, True, True, 0)
        self.button1.show()

        # Create logout button
        self.button2 = gtk.Button("Log out")
        self.button2.set_border_width(10)
        self.button2.connect("clicked", self.logout)
        self.box1.pack_start(self.button2, True, True, 0)
        self.button2.show()

        # Create reboot button
        self.button3 = gtk.Button("Reboot")
        self.button3.set_border_width(10)
        self.button3.connect("clicked", self.reboot)
        self.box1.pack_start(self.button3, True, True, 0)
        self.button3.show()

        # Create shutdown button
        self.button4 = gtk.Button("Shutdown")
        self.button4.set_border_width(10)
        self.button4.connect("clicked", self.shutdown)
        self.box1.pack_start(self.button4, True, True, 0)
        self.button4.show()

        self.box1.show()
        self.window.show()

def main():
    gtk.main()

if __name__ == "__main__":
    gogogo = DoTheLogOut()
    main()

Just add a line to your sudoers file like:

username ALL=(ALL) NOPASSWD: /sbin/shutdown

Offline

#3 2010-09-25 06:54:10

rich
#! Junkie
From: barcelona
Registered: 2009-01-26
Posts: 414
Website

Re: Problems running GDM-free: wireless, logout problems

And for the wireless connection, I would suggest configuring it manually and getting rid of network-manager and nm-applet.

*note* sometimes, your wlan0 or eth0 can be reported as UP at boot even though it isn't. Try adding this to /etc/rc.local (yes take the wireless card down twice)

ifdown wlan0
ifdown wlan0
ifup wlan0

Now in your /.config/openbox/autostart.conf Change the wait time for nm-applet to come up, this will allow your card time to come up and THEN attempt a wireless connection first. (change 4 to 10)

# Launch network manager applet
(sleep 4s && nm-applet) &

If you do need a gui to connect to the network, try Wicd. The autoconnect feature for nm-applet has never been 100% on most machines, especially with wireless.

If you don't like Wicd, you can just replace it with network-manager again.

Offline

#4 2010-09-25 13:21:56

bolle
#! CrunchBanger
Registered: 2009-10-25
Posts: 228

Re: Problems running GDM-free: wireless, logout problems

sorry ii dont have an answer to your problems, but ccould you help me wwith deleting gdm and autostarting x?
maybe send me a pm about it big_smile

thanks alot !


I once installed gentoo. It asked me for a sacrifice and would not install itself unless I gave him my neighbor's first born and my best bottle of Whiskey.  -Awebb 2011

Offline

#5 2010-09-25 14:43:33

shazbot
Member
From: Boston, USA
Registered: 2010-05-14
Posts: 32
Website

Re: Problems running GDM-free: wireless, logout problems

Thanks for all the advice, everyone!

Anon, that script looks fantastic. I'll try it out right away and report back if I have any problems.

Rich, I don't use Network Manager on my desktop, but on my laptop I hop around to a bunch of different APs that have those annoying click-through web forms to get internet access, and I find that I usually need to go to X to negotiate a connection anyway, so I leave it installed and use cnetworkmanager on the console when I'm on a friendlier AP. Actually, I quite like the way cnetworkmanager works, I've found it to be faster to get connected than doing it the old way in most cases.

Bolle, my X doesn't autostart when I log into the console, because usually I just run Emacs, check my mail, and start coding. If I want to browse graphics-heavy websites or play in Gimp or something else that requires graphics, I type "startx" to go to an X session.

To use startx just make a file in your home directory called .xinitrc and then put this line in it:

exec openbox-session

If you do want to automatically startx on login, you could set up your .bash_profile to run startx when you log in on tty1. This goes on the bottom of .bash_profile:

if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
  startx
  logout
fi

I ran across that snippet at the Arch Wiki a while ago and I haven't tested it but I don't see any reason why it wouldn't work for Crunchbang.

Oh, and to get rid of GDM just run this:

sudo apt-get remove gdm

And of course if something breaks or you decide you don't like it, use install instead of remove to put it back. If you're running the default Crunchbang desktop with Network Manager like I am, you might also want to apt-get install a program called cnetworkmanager, which allows you to manage your connection from the console. If you mess up your .xinitrc and can't get into an X session for some reason, you can use cnetworkmanager to establish a network connection so you can reinstall packages from the net.

Offline

#6 2010-09-25 16:59:35

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 3,265
Website

Re: Problems running GDM-free: wireless, logout problems

GDM also does some esoteric permissions stuff related to consolekit, hal, dbus, policykit... so life without it can be complicated.
I don't claim to understand it properly, but you might try using 'exec ck-launch-session openbox-session' in your .xinitrc.
It might just make a difference.

There isn't much documentation on all this, but to get dbus running it might also be necessary to add this to your ~/.config/openbox/autostart.sh

if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi

Try googling ck-launch-session roll
https://bbs.archlinux.org/viewtopic.php?pid=637913
https://bbs.archlinux.org/viewtopic.php?pid=744354


John     Please help us keep your forums manageable.
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#7 2010-09-26 13:45:04

bolle
#! CrunchBanger
Registered: 2009-10-25
Posts: 228

Re: Problems running GDM-free: wireless, logout problems

wow thanks so much guys! i kinda hijjacked this thread :S
sorry! tongue


I once installed gentoo. It asked me for a sacrifice and would not install itself unless I gave him my neighbor's first born and my best bottle of Whiskey.  -Awebb 2011

Offline

#8 2010-09-30 03:28:10

shazbot
Member
From: Boston, USA
Registered: 2010-05-14
Posts: 32
Website

Re: Problems running GDM-free: wireless, logout problems

Until I can figure out how to recreate whatever permissions-related things GDM sets up on login, I've reinstalled it. I've kept anon's logout script though. I like it.

I'm low on free time right now but I plan to do some research and come back to this problem. I know I'm probably not the only one for whom most of GDM's functionality is overkill.

Offline

#9 2010-10-04 01:22:19

Adrian678
New Member
Registered: 2010-10-04
Posts: 1

Re: Problems running GDM-free: wireless, logout problems

I do actually agree,have same problem.
It do generate error when i started to make some set up GDM.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo