Announcement

Collapse
No announcement yet.

Synaptiks crashes

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Synaptiks crashes

    I have the latest synaptiks installed and when I put my pc to sleep and then turn it up again, synaptiks crashes and I have to start it again. Can this be fixed somehow?

    #2
    What version do you have?
    Code:
    synaptiks -v
    It sounds like a known bug Bug 283173 – synaptiks-0.7 crashed after suspend with ALPS touchpad that is apparently fixed with 0.8.0 of synaptiks
    I'd rather be locked out than locked in.

    Comment


      #3
      Qt: 4.8.1
      KDE Development Platform: 4.8.3 (4.8.3)
      synaptiks: 0.8.1

      Comment


        #4
        So - not fixed as they claimed.

        I would add your information to the bug I linked above (just for information, since it's not actually a KDE project package), and go to Issues · lunaryorn/synaptiks · GitHub to report the bug. Synaptiks crashes after resuming pc looks like the relevant bug.
        I'd rather be locked out than locked in.

        Comment


          #5
          Same here, synaptiks 0.8.1 crashes when laptop goes to sleep. Highly annoying.

          I wonder if there is a sleep/resume hook that I could close synaptiks and then start it again on sleep/resume to avoid the crash?

          For example:

          on sleep: kill synaptiks

          on resume: synaptiks

          I know there is a /etc/pm/sleep.d/ where you can put scripts in there and do stuff on sleep and resume, but how could I start synaptics as my user, or is there a user level way to detect sleep/resume events? If you catch my drift.
          Last edited by eggbert; Jun 03, 2012, 03:40 PM.

          Comment


            #6
            Answering my own question here in case it helps someone else. What I did was make the following small script in /etc/pm/sleep.d

            Code:
            #!/bin/bash
            #
            # Kill and restart synaptiks to avoid crash on sleep/resume
            #
            
            case "$1" in
                hibernate|suspend) 
                  killall synaptiks
                ;;
                thaw|resume)
                    export DISPLAY=:0
                    su -c - bob synaptiks ;;
                *) ;;
            esac
            then made it executable:

            Code:
            chmod +x 11_synaptiks.sh
            Now when my laptop wakes, no more synaptiks crash

            There's probably a much better way to do this, but I am lazy and just got sick of seeing the kcrash dialog. So this will do for now.

            If you use this make sure to change the line

            Code:
            su -c - bob synaptiks
            To reflect YOUR username. My user is 'bob' yours will be different.

            Anyway, would love to know if there is a better way to do this.
            Last edited by eggbert; Jun 03, 2012, 04:38 PM.

            Comment


              #7
              Shouldn't you be ending your case statement with esac?
              Windows no longer obstructs my view.
              Using Kubuntu Linux since March 23, 2007.
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                Whoops, yes. Didn't get that when i copy pasted. Edited my post to include it.

                Comment


                  #9
                  Good workaround, eggbert. I've saved that script and will let you know if the problem recurs for me.
                  I'd rather be locked out than locked in.

                  Comment


                    #10
                    It seems that the script works well for me. Thanks

                    Comment


                      #11
                      Well, this has a couple problems I have observed.

                      1. If synaptiks is not running the laptop won't sleep. I think the killall command is returning an error if it can't kill a non existant process and not letting the script complete? I tried sending stderr and stdout to /dev/null but it didn't work. Hmm, how could it check if a process is running before trying to kill it, or surpress errors when trying to kill a non-existant process?

                      2. Obviously if you are logged in as a different user it will not work. It would be cool if you could do su -c - $current_user synaptiks or something along those lines. Is there a variable for the current user, anyone know?

                      3. Oddly, when it gets restarted in the script, kde won't remember to auto start synaptiks after a boot. (Synaptiks has a checkbox to auto start, but therein lies yet another synaptiks bug that will make the window popup every time you log into kde)

                      Comment


                        #12
                        Good catch.

                        The exit code of killall will be non-zero in this case, and I think by default this means the script completes but returns the same exit status (the exit code of the last executed command).

                        An explicit "exit 0" at the end would sort out this issue.

                        Simply testing if the process exists as in
                        Code:
                        pgrep synaptiks && killall synaptiks
                        would not help because then the exit status of pgrep (1 if not found) would be used! ... another command would have to be executed to clear the last-exit-status, but I'm not sure what the cleanest way to do this is.

                        Not sure about points 2 and 3. But for point 2, what if more than one user is logged in? synaptiks would have to be restarted for each one. So the problem is not so much to find the current user, but to find all logged in users with a GUI display. I think.
                        Last edited by SecretCode; Jun 04, 2012, 12:44 PM.
                        I'd rather be locked out than locked in.

                        Comment


                          #13
                          Ah did not think about multiple users being logged in. Tweaked the work around to check which users are using plasma-desktop and to exit properly. Seems to work ok now, except for point 3, kde won't autostart it... but oh well at lest no more annoying crashes.

                          Code:
                          #!/bin/bash
                          #
                          # Kill and restart synaptiks to avoid crash on sleep/resume
                          #
                          
                          case "$1" in
                              hibernate|suspend) 
                                killall -q synaptiks ;;
                              thaw|resume)	
                          	export DISPLAY=:0
                          	ps aux | grep plasma-desktop | cut -d' ' -f1 | uniq | while read i; do su -c - $i synaptiks & done ;;
                              *) ;;
                          esac
                          exit 0

                          Comment


                            #14
                            Have same problem with my Kubuntu - good to know the bug is known and is being worked on.

                            Comment

                            Working...
                            X