Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 61

Thread: Slow login on Xubuntu 12.04

  1. #11
    Join Date
    Jul 2006
    Location
    Cambridge, England
    Beans
    55
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Slow login on Xubuntu 12.04

    I have been shut down for a while.

    This startup, login to Xubuntu was immediate. Unexpected. Therefore I logged out/back in and the 30/60 second delay reappeared. Also a message requesting a restart appeared, although I can think of no reason for this, as I have done nothing but start and login.

    So I shutdown for a minute, then started again. Xubuntu login immediate, logout/login ... Xubuntu login immediate.

    Back to normal? shhh .. not too loud.
    Non-technical oldie

  2. #12
    Join Date
    Mar 2009
    Location
    Denmark
    Beans
    23
    Distro
    Ubuntu

    Re: Slow login on Xubuntu 12.04

    I'm in the same situation with Ubuntu 12.04 here! Mine also takes > 1 minute to login.

    Specs: Lenovo W520, Intel i7-2720QM @ 2.20GHz, Nvidia Quadro 2000M
    Last edited by andersgb1; May 6th, 2012 at 09:44 AM. Reason: Forgot specs
    Lenovo W520 | NVIDIA Quadro 2000M | Ubuntu 11.04 64-bit

  3. #13
    Join Date
    Sep 2006
    Beans
    26
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Slow login on Xubuntu 12.04

    It appears that the issue is from 3 method calls timing out. I changed my /etc/init/lightdm.conf line from:
    exec lightdm
    To:
    exec lightdm --log-dir=/var/log/lightdm

    Now I had some log information. Looking at the log I find 3 entries that are clearly causing the issue:
    [+11.58s] DEBUG: Greeter quit
    [+36.60s] WARNING: Could not call SetXSession: Timeout was reached
    [+61.63s] WARNING: Could not call FindUserByName: Timeout was reached
    [+61.63s] DEBUG: Dropping privileges to uid 1000
    [+61.63s] DEBUG: Restoring privileges
    [+86.65s] WARNING: Could not call FindUserByName: Timeout was reached

    Notice the times. I downloaded the source code and dug through it, it looks like there are only 3 dbus calls in the entire code base, and all 3 are timing out.

    answer = g_dbus_proxy_call_sync (proxy,
    method,
    args,
    G_DBUS_CALL_FLAGS_NONE,
    1000,
    NULL,
    &error);
    if (error)
    g_warning ("Could not call %s: %s", method, error->message);

    The calls are:
    success = call_method (proxy, "FindUserByName", g_variant_new ("(s)", user), "(o)", &result);
    call_method (user->priv->proxy, "SetXSession", g_variant_new ("(s)", xsession), "()", NULL);

    I have an encrypted home folder, so to ensure that wasn't jamming me up, I ran the dbus commands directly:
    time dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.FindUserByName string:linaro
    real 0m25.022s

    Exactly the timeout we are seeing in the logs... Now we're getting somewhere. I'm spending time looking through dbus docs to figure out the problem with these calls.

    Edit:
    I've been checking my dbus setup with d-feet. When I first run d-feet, AccountServices has no methods listed. It appears that restarting the accounts-daemon in /usr/lib/accountsservices causes the required dbus methods to show up. Something is wrong with how this program starts up. I'm not sure what the fix is yet.

    Edit:
    Almost have a fix.
    I reboot my machine.
    Wait until login screen comes up.
    Hit Ctrl+Alt+F1, log in.

    Restart the accounts-daemon:
    ps -aef | grep accounts-daemon
    root 2908 1 0 12:52 tty1 00:00:00 /usr/lib/accountsservice/accounts-daemon
    sudo kill 2908
    /usr/lib/accountsservice/accounts-daemon

    Ctrl+Alt+F7
    Log into XFCE, INSTANTLY IT LOGS IN!!!!! I just need to figure out a smooth way to restart the daemon. I tried doing it inside S99 local, and it didn't work. Going to keep poking around. Almost there.

    -Orbital
    Last edited by Orbital_sFear; May 8th, 2012 at 08:58 PM.

  4. #14
    Join Date
    May 2011
    Beans
    2

    Re: Slow login on Xubuntu 12.04

    Can't thank you enough for looking into this. I too am having this issue on an A8-3530 laptop. I thought initially it was my hardware but my proprietary AMD drivers installed (after much deliberation with jockey) and then the slow bootup came. If you find out what or where this is going let me know and I'll test some things on my end. Thanks for looking into this, I know it is just a test of patience but I like my distro to be very fast.

  5. #15
    Join Date
    Sep 2006
    Beans
    26
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Slow login on Xubuntu 12.04

    Alrighty,I have a hack-tastic solution for you guys.

    As stated in my previous posts, the issue appears to be how/when accounts service accounts-daemon is started.

    This "fix" restarts the accounts-daemon, after a successful login has been detected by lightdm. After the restart, startxfce4 is called and your window manager boots up. This works every time for me.

    Please note, I log in with the xubuntu session type, if you use a different one, this script will need to be installed in the one you use. Your xsessions live in /usr/share/xsessions

    Applying the "fix":
    1. Login
    2. cd /usr/share/xsessions
    3. Edit xubuntu.desktop:
    . Replace the follow:
    Exec=startxfce4
    To read:
    Exec=startxfce4-modified

    4. cd /usr/bin
    5. Create a file called startxfce4-modified, and store the following script into it:
    #!/bin/bash

    #Restart the accounts daemon
    ps -aef | grep accounts-daemon | grep -v grep | awk '{print $2}' | xargs kill -9
    /usr/lib/accountsservice/accounts-daemon &
    startxfce4

    6. Ensure the permissions are correct on the script:
    sudo chmod 755 /usr/bin/startxfce4-modified

    7. Reboot

    I hope this helps someone. I was going nuts with the slow boots. As stated, this is more of a hack than a fix. The real fix would be fore accounts-daemon to startup correctly.

    EDIT: Bug Report: https://bugs.launchpad.net/ubuntu/+s...ta/+bug/996791

    -Orbital
    Last edited by Orbital_sFear; May 8th, 2012 at 10:50 PM.

  6. #16
    Join Date
    May 2011
    Beans
    19

    Re: Slow login on Xubuntu 12.04

    Awesome instructions Orbital_sFear

    I am also suffering this problem.
    I tried your workaround from your first post, using tty1 and manually restarting accounts-daemon, which worked.

    I also installed your script to achieve the same effect, but it doesn't work.

    Strangely, I have a 'pristine' user I just created who logs in perfectly, with or without the modified script.

    However my login which suffers the problem still doesn't work even with the script installed. It still delays.

    Lightdm log messages from my login:
    Code:
    [+150.13s] DEBUG: Using session xubuntu
    [+150.13s] DEBUG: Stopping greeter
    [+150.13s] DEBUG: Session 2635: Sending SIGTERM
    [+150.16s] DEBUG: Session 2635 exited with return value 0
    [+150.16s] DEBUG: Greeter quit
    [+175.19s] WARNING: Could not call SetXSession: Timeout was reached
    [+200.22s] WARNING: Could not call FindUserByName: Timeout was reached
    [+200.22s] DEBUG: Dropping privileges to uid 1000
    [+200.22s] DEBUG: Restoring privileges
    [+225.25s] WARNING: Could not call FindUserByName: Timeout was reached
    [+225.25s] DEBUG: Dropping privileges to uid 1000
    [+225.25s] DEBUG: Writing /home/ian/.dmrc
    [+225.25s] DEBUG: Restoring privileges
    [+225.25s] DEBUG: Starting session xubuntu as user ian
    and from the 'pristine' user - you can see the script does work for this user:

    Code:
    [+11.19s] DEBUG: Greeter requests session xubuntu
    [+11.19s] DEBUG: Using session xubuntu
    [+11.19s] DEBUG: Stopping greeter
    [+11.19s] DEBUG: Session 1628: Sending SIGTERM
    [+11.21s] DEBUG: Session 1628 exited with return value 0
    [+11.21s] DEBUG: Greeter quit
    [+11.21s] DEBUG: Dropping privileges to uid 1001
    [+11.21s] DEBUG: Restoring privileges
    [+11.21s] DEBUG: Dropping privileges to uid 1001
    Any ideas why I'm not getting some script-love from my normal login?

  7. #17
    Join Date
    Sep 2006
    Beans
    26
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Slow login on Xubuntu 12.04

    Hey coleman_ian,

    My first question would be, are you sure the script is running? I recommend adding some debug lines into the script:

    #!/bin/bash

    echo "Script Started" > /tmp/startxfce4_log

    #Restart the accounts daemon
    echo "PID Before Kill" >> /tmp/startxfce4_log
    ps -aef | grep accounts-daemon | grep -v grep | awk '{print $2}' >> /tmp/startxfce4_log

    #Restart
    ps -aef | grep accounts-daemon | grep -v grep | awk '{print $2}' | xargs kill -9
    /usr/lib/accountsservice/accounts-daemon &

    echo "PID After Kill" >> /tmp/startxfce4_log
    ps -aef | grep accounts-daemon | grep -v grep | awk '{print $2}' >> /tmp/startxfce4_log
    sleep 1

    startxfce4


    After you boot, go check that the log file exists and that the numbers look possible. If the tty1 method worked for you, then the script should provide the same results I'm getting.

    -Orbital

  8. #18
    Join Date
    May 2011
    Beans
    19

    Re: Slow login on Xubuntu 12.04

    Quote Originally Posted by Orbital_sFear View Post
    Hey coleman_ian,

    My first question would be, are you sure the script is running? I recommend adding some debug lines into the script:

    -Orbital
    I changed the script to have some debug lines (and added some timing lines) and found that yes it was running, and there is still the delay when logging in.

    I also tried manually stopping the process from tty1 and then logging in, which gave me no delay. The process changed from PID 16** to 26** when I manually killed then restarted it.

    I have the following two logs:

    With no manual kill (ie normal gui login)
    Code:
    Script Started
    13:57:14.678893897
    PID Before Kill
    1657
    13:57:14.695178949
    13:57:14.711257373
    13:57:14.712579821
    PID After Kill
    1657
    13:57:14.727990199

    After manual kill in tty1
    Code:
    Script Started
    13:59:57.373258145
    PID Before Kill
    2615
    13:59:57.392570473
    13:59:57.417445537
    13:59:57.420058056
    PID After Kill
    2615
    13:59:57.440810428
    For my own interest I also tried running the script without restarting the accounts-daemon, ie with the kill only, but still there was the login delay.
    Code:
    Script Started
    14:06:57.610547014
    PID Before Kill
    1629
    14:06:57.625700170
    PID After Kill
    1629
    14:06:57.655398321
    Seems like the kill command isn't working, so to confirm here is the line in my script:
    Code:
    ps -aef | grep accounts-daemon | grep -v grep | awk '{print $2}' | xargs kill -9
    It appears that the script is taking a long time to initialise, because when it runs it takes very little time. I'm unsure why the script is taking so long to get called, any ideas on how to find out would be great.

  9. #19
    Join Date
    Sep 2006
    Beans
    26
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Slow login on Xubuntu 12.04

    Hey coleman,

    It looks like there are permission issues going on. Waking up this morning my script wasn't working either. I made a quick c wrapper to ensure that my SUID bit was set and things were running as root.

    Still have slow boot ups =( I really don't know what changed, it was working yesterday.

    -Orbital

  10. #20
    Join Date
    Sep 2006
    Beans
    26
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Slow login on Xubuntu 12.04

    Alrighty, I have a more hackish solution that actually works now. I've done more research. It looks like the correct time for accounts_daemon to start is while the user owned lightdm --session-child is running.

    I made a script which starts just before lightdm, and then watches for lightdm session-child to start. Keep in mind this is a total hack.

    If anyone has followed my previous post on the startxfce4-modifed script, please remove that script, and set your xsession back to startxfce4.

    Brief explanation about what this does. We will save two script files into your /usr/sbin folder (The same folder where lightdm lives). Ensure the permissions allow those to run. Then we will edit your lightdm upstart job to run the scripts. One of the scripts simply calls the other, and then starts lightdm. The other runs a ps -aef every 0.5 seconds looking for a lightdm session child that isn't running as root. When one is found, it restarts the accounts_daemon.

    We run in between lightdm because lightdm is ran as root.

    Here is the list of things to do:
    1. Store the attached tar file.
    2. Extract the tar file to /usr/sbin/ (lightdm-safe and lightdm-restart)
    3. Ensure the permissions on the files are correct.
    cd /usr/sbin
    sudo chown root:root lightdm-safe lightdm-restart
    sudo chmod 755 lightdm-safe lightdm-restart
    4. Edit /etc/init/lightdm.conf:
    Change the line that reads:
    exec lightdm
    to read:
    exec lightdm-safe

    You can have extra arguments after the lightdm-safe script, they get passed through to lightdm. I have --log-file=/var/log/lightdm for arguments on mine.

    I've restarted several times with this method, and it works everytime for me.

    -Orbital
    Attached Files Attached Files

Page 2 of 7 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •