Touchpad Not Working After 18.04LTS Clean Install

Asked by marinos roussos

I have a dual Win10 boot and (K)ubuntu 18.04 on a Fujitsu Ultrabook UH572 i5/8GBram and (K)ubuntu is running on a 32GBSSD. After a clean install of (K)ubuntu 18.04 I noticed that the touchpad wasn't working...On Win everything works fine.

It's the first time I'm running Ubuntu on this machine so I don"t know what the issue could be. In the past I never had an issue with the touchpad. Maybe it has to do with the fact that its a click-touch-pad? It has no buttons just a big area, kind like a Mac.....

In any case I can see the touchpad when typing xinput list in terminal. Below the output:

kongking@UH572:~$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ USB OPTICAL MOUSE id=10 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
    ↳ Power Button id=6 [slave keyboard (3)]
    ↳ Fujitsu FUJ02E3 id=7 [slave keyboard (3)]
    ↳ Video Bus id=8 [slave keyboard (3)]
    ↳ Power Button id=9 [slave keyboard (3)]
    ↳ FJ Camera: FJ Camera id=11 [slave keyboard (3)]
    ↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)]
I've tried editing the etc/default/grub file and replacing "quiet splash" with "acpi=force", according the link below: SynPS/2 Synaptic Touchpad not working in Ubuntu 17.10, with no luck.

Any ideas how to tackle this??

Many thanks,

μρ .

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Is there a switch to enable or disable the touch pad? If so, use it. Is the touch pad enabled in BIOS?

Revision history for this message
marinos roussos (marinos-roussos) said :
#2

Hey Andrew,

Thanks for your reply.

Well in Windows10 everything is working fine...

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3
Revision history for this message
marinos roussos (marinos-roussos) said :
#4

Worked like a charm
:-)

Many thanks

Revision history for this message
marinos roussos (marinos-roussos) said :
#5

Hey,
sorry to bother you again but...

...I just noticed that after sleep/hibernation the touchpad doesn't work...

μρ .

Revision history for this message
marinos roussos (marinos-roussos) said :
#6

Hello again....

can anyone help me use my touchpad after sleep/hibernation ?

Many thanks
m.

Revision history for this message
marinos roussos (marinos-roussos) said :
#7

Hey again,

With some research I've done here I found an answer to a similar question in this thread here:
Keyboard and touchpad doesn't work after stanby or hibernation (ubuntu 10.04):
(https://answers.launchpad.net/ubuntu/+source/acpi/+question/137940)

"...so in /etc/default/grub i wrote string:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash kbd.reset"
After that keyboard works after suspend and hibernation mode. I tested it about 10 times, so I think my problem is solved. :)"

The issue, maybe would be that, I have already edited my /etc/default/grub to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.notimeout i8042.nomux

How can I try to see if this solution helps?

ΤΝX
μ.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

Just edit the line in the file and run:

sudo update-grub

Reboot to test

Revision history for this message
marinos roussos (marinos-roussos) said :
#9
Revision history for this message
marinos roussos (marinos-roussos) said :
#10

I added the extra line below the existing one...
...but it got worse.
After the reboot the touchpad wasn't working at all

On Wed, Jul 25, 2018 at 9:17 PM μρ . <email address hidden> wrote:

> Hey,
>
> *Just edit the line in the file*
>
> Shall I, for example, add the sting
> GRUB_CMDLINE_
>
> LINUX_DEFAULT="quiet splash kbd.reset"
>
> below?
>
>
> On 25/07/2018 09:03 μμ, actionparsnip wrote:
>
> Your question #670757 on Ubuntu changed:https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> actionparsnip proposed the following answer:
> Just edit the line in the file and run:
>
> sudo update-grub
>
> Reboot to test
>
>
>
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

For following the two different instructions at the same time you have to combine the parameters.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.notimeout i8042.nomux kbd.reset"

Revision history for this message
marinos roussos (marinos-roussos) said :
#12

Hey Manfred,

Sorry didn't work. same issue still.

On Thu, Jul 26, 2018 at 9:53 AM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> For following the two different instructions at the same time you have
> to combine the parameters.
>
> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.notimeout i8042.nomux
> kbd.reset"
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=10
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

Which issue now - not working at all, or not working after hibernation and wakeup?

Revision history for this message
marinos roussos (marinos-roussos) said :
#14
Revision history for this message
Launchpad Janitor (janitor) said :
#15

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
marinos roussos (marinos-roussos) said :
#16

Unfortunately  the issue is still persisting.
When returning from hibernation the touch pad doesn't work any more, only a usb mouse

⁣Sent from Blue ​

On Aug 11, 2018, 11:33 AM, at 11:33 AM, Launchpad Janitor <email address hidden> wrote:
>Your question #670757 on Ubuntu changed:
>https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Expired
>
>Launchpad Janitor expired the question:
>This question was expired because it remained in the 'Open' state
>without activity for the last 15 days.
>
>--
>If you're still having this problem, you can reopen your question
>either
>by replying to this email or by going to the following page and
>entering more information about your problem:
>https://answers.launchpad.net/ubuntu/+question/670757
>
>You received this question notification because you asked the question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#17

What is now the value for GRUB_CMDLINE_LINUX_DEFAULT in your /etc/default/grub configuration file?

Revision history for this message
marinos roussos (marinos-roussos) said :
#18

Hey again,

I read:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.notimeout i
8042.nomux kbd.reset"

Thanks again for your effort.

M.
⁣Sent from Blue ​

On Aug 12, 2018, 10:23 AM, at 10:23 AM, Manfred Hampl <email address hidden> wrote:
>Your question #670757 on Ubuntu changed:
>https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Needs information
>
>Manfred Hampl requested more information:
>What is now the value for GRUB_CMDLINE_LINUX_DEFAULT in your
>/etc/default/grub configuration file?
>
>--
>To answer this request for more information, you can either reply to
>this email or enter your reply at the following page:
>https://answers.launchpad.net/ubuntu/+question/670757
>
>You received this question notification because you asked the question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#19

Is there a space inside "i 8042.nomux"? That should not be.

Revision history for this message
marinos roussos (marinos-roussos) said :
#20

No there's not a space.
Sorry, was a typo

⁣Sent from Blue ​

On Aug 12, 2018, 10:03 PM, at 10:03 PM, Manfred Hampl <email address hidden> wrote:
>Your question #670757 on Ubuntu changed:
>https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Needs information
>
>Manfred Hampl requested more information:
>Is there a space inside "i 8042.nomux"? That should not be.
>
>--
>To answer this request for more information, you can either reply to
>this email or enter your reply at the following page:
>https://answers.launchpad.net/ubuntu/+question/670757
>
>You received this question notification because you asked the question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#21

Ok.

If the touchpad is working after boot, but no more after hibernation and wake-up, then it seems to need some additional trigger at wake-up to get working again.

Some possibilities (found by a web search)

sudo modprobe -r psmouse
sudo modprobe psmouse

or

synclient TouchpadOff=1
synclient TouchpadOff=0

I suggest that you boot your system, but it into sleep mode and wake it up again.
If the touchpad is not working, try the first pair of commands. Does it bring the touchpad back into operation and/or show error messages?
Try the same with the second pair of commands.
And finally report the results.

Revision history for this message
marinos roussos (marinos-roussos) said :
#22

Hey and many thanks for your effort,

I tried both sets into sleep mode and had following results:
Both sets didn't produce any error message BUT the fist set worked, in a
way, while the second set didn't work at all- the touchpad stayed frozen.
The fist set of commands seems more promising though as the touchpad from
frozen went alive after the second command (sudo modprobe psmouse).
The problem is that after a restart and a hibernation the same issue comes
back.

On Mon, Aug 13, 2018 at 9:44 AM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> Ok.
>
> If the touchpad is working after boot, but no more after hibernation and
> wake-up, then it seems to need some additional trigger at wake-up to get
> working again.
>
> Some possibilities (found by a web search)
>
> sudo modprobe -r psmouse
> sudo modprobe psmouse
>
> or
>
> synclient TouchpadOff=1
> synclient TouchpadOff=0
>
> I suggest that you boot your system, but it into sleep mode and wake it up
> again.
> If the touchpad is not working, try the first pair of commands. Does it
> bring the touchpad back into operation and/or show error messages?
> Try the same with the second pair of commands.
> And finally report the results.
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#23

1. At least as a workaround you already know how to revive the touchpad after hibernation.

2. It is possible to automate this, such that the commands are always executed when the system wakes up from hibernation.
Examples are available in https://mariogalan.com/en/content/execute-script-after-suspend-ubuntu-1604 and https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/

Revision history for this message
marinos roussos (marinos-roussos) said :
#24

hey,

I wrote, according the second follow-up (
https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/)
this

*#!bin/bash*

*# Restart Touchpad*

*if [ "${1}" == "pre" ]; then*
*# nothing goes here*

*elif [ "${1}" == "post" ]; then*
*sudo modprobe -r psmouse*
*sudo modprobe psmouse*
*fi*

I named it Restart Touchpad and saved in in */lib/systemd/system-sleep/*
Something must be fishy because it didn't work as planned. After
hibernation touchpad is still frozen.

With the fist link
https://mariogalan.com/en/content/execute-script-after-suspend-ubuntu-1604 I
couldn't figure it out.

On Mon, Aug 13, 2018 at 5:13 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> 1. At least as a workaround you already know how to revive the touchpad
> after hibernation.
>
> 2. It is possible to automate this, such that the commands are always
> executed when the system wakes up from hibernation.
> Examples are available in
> https://mariogalan.com/en/content/execute-script-after-suspend-ubuntu-1604
> and
> https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=22
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#25

What is the output of
ls -l /lib/systemd/system-sleep/

Revision history for this message
marinos roussos (marinos-roussos) said :
#26

here's the output:
kongking@UH572:~$ ls -l /lib/systemd/system-sleep/
total 12
-rwxr-xr-x 1 root root 92 Φεβ 22 15:51 hdparm
-rw-r--r-- 1 root root 165 Αυγ 13 21:10 'Restart Touchpad'
-rwxr-xr-x 1 root root 219 Ιουλ 18 14:22 unattended-upgrades

On Mon, Aug 13, 2018 at 10:32 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> What is the output of
> ls -l /lib/systemd/system-sleep/
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#27

1. I recommend not to use special characters like space in a file name like this.

2. You have to give "execute" permission to that file (sudo chmod a+x filename).
If you re-check with "ls -l" afterwards, you should see -rwxr-xr-x like the other files.

Revision history for this message
marinos roussos (marinos-roussos) said :
#28

I changed the name to restarttouchpad and run the command:
*sudo chmod a+x restarttouchpad*
the output now looks like the other entries but I still have a frozen
touchpad after returning from sleep mode.
Below the output:
kongking@UH572:~$ ls -l /lib/systemd/system-sleep/
total 12
-rwxr-xr-x 1 root root 92 Φεβ 22 15:51 hdparm
-rwxr-xr-x 1 root root 164 Αυγ 13 23:10 restarttouchpad
-rwxr-xr-x 1 root root 219 Ιουλ 18 14:22 unattended-upgrades

On Mon, Aug 13, 2018 at 10:57 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> 1. I recommend not to use special characters like space in a file name
> like this.
>
> 2. You have to give "execute" permission to that file (sudo chmod a+x
> filename).
> If you re-check with "ls -l" afterwards, you should see -rwxr-xr-x like
> the other files.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=26
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#29

What happens if you wake up your computer and execute

/lib/systemd/system-sleep/restarttouchpad post

Does this bring the touchpad back to function?

Try removing "sudo" from the two lines. This should not be necessary, because the script already runs with admin privileges when started my systemd at wakeup.

Another possibility: Timing problems.
Add "sleep 5" bevor the first modprobe command.

Revision history for this message
marinos roussos (marinos-roussos) said :
#30

"What happens if you wake up your computer and execute
/lib/systemd/system-sleep/restarttouchpad *post*"
What is the "post" at the end?

I executed in terminal like this, obviously wrong as i get back an error
message

*kongking@UH572:/lib/systemd/system-sleep$ sudo chmod +x restarttouchpad*
*[sudo] password for kongking: *
*kongking@UH572:/lib/systemd/system-sleep$ ./restarttouchpad*
*bash: ./restarttouchpad: bin/bash: bad interpreter: No such file or
directory*

my restarttouchpad file looks like this now, I removed sudo
*#!bin/bash*
*# restarttouchpad*

*if [ "${1}" == "pre" ]; then*
*# nothing goes here*

*elif [ "${1}" == "post" ]; then*
*modprobe -r psmouse*
*modprobe psmouse*
*fi*

I'll try your second option "*Add "sleep 5" bevor the first modprobe
command*."
and report back.

On Tue, Aug 14, 2018 at 12:17 AM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> What happens if you wake up your computer and execute
>
> /lib/systemd/system-sleep/restarttouchpad post
>
> Does this bring the touchpad back to function?
>
> Try removing "sudo" from the two lines. This should not be necessary,
> because the script already runs with admin privileges when started my
> systemd at wakeup.
>
> Another possibility: Timing problems.
> Add "sleep 5" bevor the first modprobe command.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=28
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
marinos roussos (marinos-roussos) said :
#31

Also inserting sleep 5 didn't work.

*#!bin/bash*
*# restarttouchpad*

*if [ "${1}" == "pre" ]; then*
*# nothing goes here*

*elif [ "${1}" == "post" ]; then*
*sleep 5*
*modprobe -r psmouse*
*modprobe psmouse*
*fi*

On Tue, Aug 14, 2018 at 12:48 AM μρ . <email address hidden> wrote:

> "What happens if you wake up your computer and execute
> /lib/systemd/system-sleep/restarttouchpad *post*"
> What is the "post" at the end?
>
> I executed in terminal like this, obviously wrong as i get back an error
> message
>
> *kongking@UH572:/lib/systemd/system-sleep$ sudo chmod +x restarttouchpad*
> *[sudo] password for kongking: *
> *kongking@UH572:/lib/systemd/system-sleep$ ./restarttouchpad*
> *bash: ./restarttouchpad: bin/bash: bad interpreter: No such file or
> directory*
>
> my restarttouchpad file looks like this now, I removed sudo
> *#!bin/bash*
> *# restarttouchpad*
>
> *if [ "${1}" == "pre" ]; then*
> *# nothing goes here*
>
> *elif [ "${1}" == "post" ]; then*
> *modprobe -r psmouse*
> *modprobe psmouse*
> *fi*
>
> I'll try your second option "*Add "sleep 5" bevor the first modprobe
> command*."
> and report back.
>
> On Tue, Aug 14, 2018 at 12:17 AM Manfred Hampl <
> <email address hidden>> wrote:
>
>> Your question #670757 on Ubuntu changed:
>> https://answers.launchpad.net/ubuntu/+question/670757
>>
>> Status: Open => Answered
>>
>> Manfred Hampl proposed the following answer:
>> What happens if you wake up your computer and execute
>>
>> /lib/systemd/system-sleep/restarttouchpad post
>>
>> Does this bring the touchpad back to function?
>>
>> Try removing "sudo" from the two lines. This should not be necessary,
>> because the script already runs with admin privileges when started my
>> systemd at wakeup.
>>
>> Another possibility: Timing problems.
>> Add "sleep 5" bevor the first modprobe command.
>>
>> --
>> If this answers your question, please go to the following page to let us
>> know that it is solved:
>>
>> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=28
>>
>> If you still need help, you can reply to this email or go to the
>> following page to enter your feedback:
>> https://answers.launchpad.net/ubuntu/+question/670757
>>
>> You received this question notification because you asked the question.
>>
>

Revision history for this message
marinos roussos (marinos-roussos) said :
#32

Hey again,
The second option, after a restart worked once...
I mean one time returning from hibernation it works fine, but after a
second hibernation not any more....
but we are getting closer...... that's good

On Tue, Aug 14, 2018 at 12:52 AM marinos roussos <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You gave more information on the question:
> Also inserting sleep 5 didn't work.
>
> *#!bin/bash*
> *# restarttouchpad*
>
> *if [ "${1}" == "pre" ]; then*
> *# nothing goes here*
>
> *elif [ "${1}" == "post" ]; then*
> *sleep 5*
> *modprobe -r psmouse*
> *modprobe psmouse*
> *fi*
>
>
> On Tue, Aug 14, 2018 at 12:48 AM μρ . <email address hidden> wrote:
>
> > "What happens if you wake up your computer and execute
> > /lib/systemd/system-sleep/restarttouchpad *post*"
> > What is the "post" at the end?
> >
> > I executed in terminal like this, obviously wrong as i get back an error
> > message
> >
> > *kongking@UH572:/lib/systemd/system-sleep$ sudo chmod +x
> restarttouchpad*
> > *[sudo] password for kongking: *
> > *kongking@UH572:/lib/systemd/system-sleep$ ./restarttouchpad*
> > *bash: ./restarttouchpad: bin/bash: bad interpreter: No such file or
> > directory*
> >
> > my restarttouchpad file looks like this now, I removed sudo
> > *#!bin/bash*
> > *# restarttouchpad*
> >
> > *if [ "${1}" == "pre" ]; then*
> > *# nothing goes here*
> >
> > *elif [ "${1}" == "post" ]; then*
> > *modprobe -r psmouse*
> > *modprobe psmouse*
> > *fi*
> >
> > I'll try your second option "*Add "sleep 5" bevor the first modprobe
> > command*."
> > and report back.
> >
> > On Tue, Aug 14, 2018 at 12:17 AM Manfred Hampl <
> > <email address hidden>> wrote:
> >
> >> Your question #670757 on Ubuntu changed:
> >> https://answers.launchpad.net/ubuntu/+question/670757
> >>
> >> Status: Open => Answered
> >>
> >> Manfred Hampl proposed the following answer:
> >> What happens if you wake up your computer and execute
> >>
> >> /lib/systemd/system-sleep/restarttouchpad post
> >>
> >> Does this bring the touchpad back to function?
> >>
> >> Try removing "sudo" from the two lines. This should not be necessary,
> >> because the script already runs with admin privileges when started my
> >> systemd at wakeup.
> >>
> >> Another possibility: Timing problems.
> >> Add "sleep 5" bevor the first modprobe command.
> >>
> >> --
> >> If this answers your question, please go to the following page to let us
> >> know that it is solved:
> >>
> >>
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=28
> >>
> >> If you still need help, you can reply to this email or go to the
> >> following page to enter your feedback:
> >> https://answers.launchpad.net/ubuntu/+question/670757
> >>
> >> You received this question notification because you asked the question.
> >>
> >
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#33

There seems to be a character missing in the first line. It should be
#!/bin/bash
with a slash after the exclamation mark.

Explanation for the "post" to be added when executing manually: The script is executed when going into hibernation, and at that time the parameter "pre" is used by the system, and at wake-up the script is executed with "post" as first parameter. Based on the parameter that is used when starting the script, either the first set of action (nothing) or the second (modprobe) is executed.

Revision history for this message
marinos roussos (marinos-roussos) said :
#34

Hey
I added the slash in the file, but I'm confused regarding the  execution of the script....
I suppose I have to run it from terminal.
What is the exact syntax?

⁣Sent from Blue ​

On Aug 14, 2018, 9:27 AM, at 9:27 AM, Manfred Hampl <email address hidden> wrote:
>Your question #670757 on Ubuntu changed:
>https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
>Manfred Hampl proposed the following answer:
>There seems to be a character missing in the first line. It should be
>#!/bin/bash
>with a slash after the exclamation mark.
>
>Explanation for the "post" to be added when executing manually: The
>script is executed when going into hibernation, and at that time the
>parameter "pre" is used by the system, and at wake-up the script is
>executed with "post" as first parameter. Based on the parameter that is
>used when starting the script, either the first set of action (nothing)
>or the second (modprobe) is executed.
>
>--
>If this answers your question, please go to the following page to let
>us
>know that it is solved:
>https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=32
>
>If you still need help, you can reply to this email or go to the
>following page to enter your feedback:
>https://answers.launchpad.net/ubuntu/+question/670757
>
>You received this question notification because you asked the question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#35

If everything is correct with the script, then it should be automatically be executed by certain system processes, whenever you wake up the computer from hibernating. No manual intervention required.

For testing whether the script works, you can manually start it:

sudo /lib/systemd/system-sleep/restarttouchpad post

If you get an error message, then something is (still) wrong.

Revision history for this message
marinos roussos (marinos-roussos) said :
#36

Well as I received 2 errors, so something is, still, wrong...
Here's the output:
kongking@UH572:~$ sudo /lib/systemd/system-sleep/restarttouchpad post
[sudo] password for kongking:
/lib/systemd/system-sleep/restarttouchpad: line 7: syntax error near
unexpected token `elif'
/lib/systemd/system-sleep/restarttouchpad: line 7: `elif [ "${1}" == "post"
]; then'

BTW, I noticed just now doesn't work even the one-time hibernation that
used to work when adding the sleep 5.

On Tue, Aug 14, 2018 at 2:23 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> If everything is correct with the script, then it should be
> automatically be executed by certain system processes, whenever you wake
> up the computer from hibernating. No manual intervention required.
>
> For testing whether the script works, you can manually start it:
>
> sudo /lib/systemd/system-sleep/restarttouchpad post
>
> If you get an error message, then something is (still) wrong.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=34
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#37

What is now the contents of the script?

Please provide the output of

cat -n /lib/systemd/system-sleep/restarttouchpad

(unedited, without adding stars or something else!)

Revision history for this message
marinos roussos (marinos-roussos) said :
#38

Here is the content of the script:

#!/bin/bash
# restarttouchpad

if [ "${1}" == "pre" ]; then
# nothing goes here

elif [ "${1}" == "post" ]; then
sleep 5
modprobe -r psmouse
modprobe psmouse
fi

the output of *cat -n /lib/systemd/system-sleep/restarttouchpad *is:
kongking@UH572:~$ cat -n /lib/systemd/system-sleep/restarttouchpad
    1 #!/bin/bash
    2 # restarttouchpad
    3
    4 if [ "${1}" == "pre" ]; then
    5 # nothing goes here
    6
    7 elif [ "${1}" == "post" ]; then
    8 sleep 5
    9 modprobe -r psmouse
   10 modprobe psmouse
   11 fi
   12
   13

On Tue, Aug 14, 2018 at 3:12 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> What is now the contents of the script?
>
> Please provide the output of
>
> cat -n /lib/systemd/system-sleep/restarttouchpad
>
> (unedited, without adding stars or something else!)
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#39

How did you create that file?
Maybe there are some strange unprintable characters.

Revision history for this message
marinos roussos (marinos-roussos) said :
#40

I went into the directory and chose one of two  existing files. I edited it accordingly and saved it giving my admin password.
I didn't do it via terminal. Do you think that matters??

⁣Sent from Blue ​

On Aug 14, 2018, 5:12 PM, at 5:12 PM, Manfred Hampl <email address hidden> wrote:
>Your question #670757 on Ubuntu changed:
>https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Needs information
>
>Manfred Hampl requested more information:
>How did you create that file?
>Maybe there are some strange unprintable characters.
>
>--
>To answer this request for more information, you can either reply to
>this email or enter your reply at the following page:
>https://answers.launchpad.net/ubuntu/+question/670757
>
>You received this question notification because you asked the question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#41

Which editor did you use?

Revision history for this message
marinos roussos (marinos-roussos) said :
#42

Kate, the native kubuntu application

⁣Sent from Blue ​

On Aug 14, 2018, 7:17 PM, at 7:17 PM, Manfred Hampl <email address hidden> wrote:
>Your question #670757 on Ubuntu changed:
>https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Needs information
>
>Manfred Hampl requested more information:
>Which editor did you use?
>
>--
>To answer this request for more information, you can either reply to
>this email or enter your reply at the following page:
>https://answers.launchpad.net/ubuntu/+question/670757
>
>You received this question notification because you asked the question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#43

Let's try it slightly different:
Take /lib/systemd/system-sleep/hdparm as template.

Edit /lib/systemd/system-sleep/restarttouchpad

remove all contents and replace them with the following:
<start of text>
#!/bin/sh

case $1 in
  post)
    /bin/sleep 5
    /sbin/modprobe -r psmouse
    /sbin/modprobe psmouse
    ;;
esac
<end of text>

and then try again to manually start the script - any error messages?

Revision history for this message
marinos roussos (marinos-roussos) said :
#44

Should I save it as restarttouchpad again?

On Tue, Aug 14, 2018 at 9:27 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> Let's try it slightly different:
> Take /lib/systemd/system-sleep/hdparm as template.
>
> Edit /lib/systemd/system-sleep/restarttouchpad
>
> remove all contents and replace them with the following:
> <start of text>
> #!/bin/sh
>
> case $1 in
> post)
> /bin/sleep 5
> /sbin/modprobe -r psmouse
> /sbin/modprobe psmouse
> ;;
> esac
> <end of text>
>
> and then try again to manually start the script - any error messages?
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=42
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#45

The name should not matter. Just make sure that you have only one script for the touchpad in that directory.

And finally make sure that the file has got execute rights.

Revision history for this message
marinos roussos (marinos-roussos) said :
#46

ok here is the new script:
<start of text>
#!/bin/sh

case $1 in
  post)
    /bin/sleep 5
    /sbin/modprobe -r psmouse
    /sbin/modprobe psmouse
    ;;
esac
<end of text>

I gave executive rights with the command:
kongking@UH572:/lib/systemd/system-sleep$ sudo chmod a+x restarttouchpad
and,
Here's the output of:
kongking@UH572:/lib/systemd/system-sleep$
/lib/systemd/system-sleep/restarttouchpad post
/lib/systemd/system-sleep/restarttouchpad: line 1: syntax error near
unexpected token `newline'
/lib/systemd/system-sleep/restarttouchpad: line 1: `<start of text>'

On Tue, Aug 14, 2018 at 10:52 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> The name should not matter. Just make sure that you have only one script
> for the touchpad in that directory.
>
> And finally make sure that the file has got execute rights.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=44
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#47

"<start of text>" and "<end of text>" should of course NOT be copied into the script!

Revision history for this message
marinos roussos (marinos-roussos) said :
#48

Hey again,

That's it.
It works now after any hibernation.
Many thanks for your help.

On Wed, Aug 15, 2018 at 2:47 PM Manfred Hampl <
<email address hidden>> wrote:

> Your question #670757 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> "<start of text>" and "<end of text>" should of course NOT be copied
> into the script!
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/670757/+confirm?answer_id=46
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/670757
>
> You received this question notification because you asked the question.
>

Revision history for this message
marinos roussos (marinos-roussos) said :
#49

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Manfred Hampl (m-hampl) said :
#50

What I do not know is whether the "sleep 5" delay is really necessary. You could try reducing the number, or even deleting the line. If it still works, then that would be faster. But if you are satisfied with the current solution, then better leave as it is.

Revision history for this message
marinos roussos (marinos-roussos) said :
#51

I think that I can live with a small time delay.
Once again many thanks for your time spent and help.

⁣Sent from Blue ​

On Aug 15, 2018, 8:58 PM, at 8:58 PM, Manfred Hampl <email address hidden> wrote:
>Your question #670757 on Ubuntu changed:
>https://answers.launchpad.net/ubuntu/+question/670757
>
>Manfred Hampl posted a new comment:
>What I do not know is whether the "sleep 5" delay is really necessary.
>You could try reducing the number, or even deleting the line. If it
>still works, then that would be faster. But if you are satisfied with
>the current solution, then better leave as it is.
>
>--
>You received this question notification because you asked the question.