inputattach after waking from suspend












0















In Ubuntu 16.04 I have working serial mouse. It may be started from terminal by
sudo inputattach --daemon --intellimouse /dev/ttyS0 and starts in boot process having inputattach --intellimouse /dev/ttyS0 line in /etc/rc.local



This is correct, but I failed to find a method for automatic restart after wake up from suspend. By proposition for other serial device I added 99_sermouse_restart executable script to /lib/systemd/system-sleep/ folder with content



#!/bin/bash
# suspend_inputattach() {
# inputattach automatically stops on suspend, so no need
# usr/sbin/inputattach
#}
echo "Elindult..." > /tmp/inputattach_teszt
resume_inputattach() {
echo "most ugrik..." >> /tmp/inputattach_teszt
# restart input attach program
# sleep 10s && inputattach --daemon --intellimouse /dev/ttyS0
# sleep 10s && inputattach --intellimouse /dev/ttyS0 &
killall inputattach && sleep 10s && inputattach --intellimouse /dev/ttyS0 &
# inputattach --intellimouse /dev/ttyS0 &
#echo "ugrott..." >> /tmp/inputattach_teszt
}

case "$1" in
post)
resume_inputattach
#echo "benne volt..." >> /tmp/inputattach_teszt
;;
*)
echo "nincs benne..." >> /tmp/inputattach_teszt
;;
esac
echo $? >> /tmp/inputattach_teszt
echo "befejezte..." >> /tmp/inputattach_teszt

exit $?


By /tmp/inputattach_teszt



Elindult...
most ugrik...
0
befejezte...


it is obvious, inputattach in it runs with no error, but the mouse doesn't work (have to be activated by the described terminal command). I made trials with modification of inputattach line of the script, but with no success (some of them are in the script as comments).



I found the slices of log (/var/log/Xorg.0.log) generated before, during and after inputattach. The last lines before it (from previous suspend) were removing mouse and its module. iputattach itself generated lines describing the attach process. The later steps of wake up added end of its usability:



[ 62187.541] (II) config/udev: removing device Microsoft MZ Mouse 
[ 62187.560] (II) evdev: Microsoft MZ Mouse: Close
[ 62187.561] (II) UnloadModule: "evdev"


I am afraid, the script runs earlier then it would be optimal.



My questions: (1) how to put the script into a later point of resume, or (2) how to avoid the last described step of wake up? Thank you.










share|improve this question

























  • I GAVE UP. In the narrow sense this topic would not worth the energy invested (there are RS232 connectors on the very old machines only, and after wake up the serial mouse may be started by a single command). I wanted to understand a part of the UBUNTU: how to force the system to start a daemon automatically when it wakes up. I failed.

    – HGI
    Feb 1 at 20:57
















0















In Ubuntu 16.04 I have working serial mouse. It may be started from terminal by
sudo inputattach --daemon --intellimouse /dev/ttyS0 and starts in boot process having inputattach --intellimouse /dev/ttyS0 line in /etc/rc.local



This is correct, but I failed to find a method for automatic restart after wake up from suspend. By proposition for other serial device I added 99_sermouse_restart executable script to /lib/systemd/system-sleep/ folder with content



#!/bin/bash
# suspend_inputattach() {
# inputattach automatically stops on suspend, so no need
# usr/sbin/inputattach
#}
echo "Elindult..." > /tmp/inputattach_teszt
resume_inputattach() {
echo "most ugrik..." >> /tmp/inputattach_teszt
# restart input attach program
# sleep 10s && inputattach --daemon --intellimouse /dev/ttyS0
# sleep 10s && inputattach --intellimouse /dev/ttyS0 &
killall inputattach && sleep 10s && inputattach --intellimouse /dev/ttyS0 &
# inputattach --intellimouse /dev/ttyS0 &
#echo "ugrott..." >> /tmp/inputattach_teszt
}

case "$1" in
post)
resume_inputattach
#echo "benne volt..." >> /tmp/inputattach_teszt
;;
*)
echo "nincs benne..." >> /tmp/inputattach_teszt
;;
esac
echo $? >> /tmp/inputattach_teszt
echo "befejezte..." >> /tmp/inputattach_teszt

exit $?


By /tmp/inputattach_teszt



Elindult...
most ugrik...
0
befejezte...


it is obvious, inputattach in it runs with no error, but the mouse doesn't work (have to be activated by the described terminal command). I made trials with modification of inputattach line of the script, but with no success (some of them are in the script as comments).



I found the slices of log (/var/log/Xorg.0.log) generated before, during and after inputattach. The last lines before it (from previous suspend) were removing mouse and its module. iputattach itself generated lines describing the attach process. The later steps of wake up added end of its usability:



[ 62187.541] (II) config/udev: removing device Microsoft MZ Mouse 
[ 62187.560] (II) evdev: Microsoft MZ Mouse: Close
[ 62187.561] (II) UnloadModule: "evdev"


I am afraid, the script runs earlier then it would be optimal.



My questions: (1) how to put the script into a later point of resume, or (2) how to avoid the last described step of wake up? Thank you.










share|improve this question

























  • I GAVE UP. In the narrow sense this topic would not worth the energy invested (there are RS232 connectors on the very old machines only, and after wake up the serial mouse may be started by a single command). I wanted to understand a part of the UBUNTU: how to force the system to start a daemon automatically when it wakes up. I failed.

    – HGI
    Feb 1 at 20:57














0












0








0








In Ubuntu 16.04 I have working serial mouse. It may be started from terminal by
sudo inputattach --daemon --intellimouse /dev/ttyS0 and starts in boot process having inputattach --intellimouse /dev/ttyS0 line in /etc/rc.local



This is correct, but I failed to find a method for automatic restart after wake up from suspend. By proposition for other serial device I added 99_sermouse_restart executable script to /lib/systemd/system-sleep/ folder with content



#!/bin/bash
# suspend_inputattach() {
# inputattach automatically stops on suspend, so no need
# usr/sbin/inputattach
#}
echo "Elindult..." > /tmp/inputattach_teszt
resume_inputattach() {
echo "most ugrik..." >> /tmp/inputattach_teszt
# restart input attach program
# sleep 10s && inputattach --daemon --intellimouse /dev/ttyS0
# sleep 10s && inputattach --intellimouse /dev/ttyS0 &
killall inputattach && sleep 10s && inputattach --intellimouse /dev/ttyS0 &
# inputattach --intellimouse /dev/ttyS0 &
#echo "ugrott..." >> /tmp/inputattach_teszt
}

case "$1" in
post)
resume_inputattach
#echo "benne volt..." >> /tmp/inputattach_teszt
;;
*)
echo "nincs benne..." >> /tmp/inputattach_teszt
;;
esac
echo $? >> /tmp/inputattach_teszt
echo "befejezte..." >> /tmp/inputattach_teszt

exit $?


By /tmp/inputattach_teszt



Elindult...
most ugrik...
0
befejezte...


it is obvious, inputattach in it runs with no error, but the mouse doesn't work (have to be activated by the described terminal command). I made trials with modification of inputattach line of the script, but with no success (some of them are in the script as comments).



I found the slices of log (/var/log/Xorg.0.log) generated before, during and after inputattach. The last lines before it (from previous suspend) were removing mouse and its module. iputattach itself generated lines describing the attach process. The later steps of wake up added end of its usability:



[ 62187.541] (II) config/udev: removing device Microsoft MZ Mouse 
[ 62187.560] (II) evdev: Microsoft MZ Mouse: Close
[ 62187.561] (II) UnloadModule: "evdev"


I am afraid, the script runs earlier then it would be optimal.



My questions: (1) how to put the script into a later point of resume, or (2) how to avoid the last described step of wake up? Thank you.










share|improve this question
















In Ubuntu 16.04 I have working serial mouse. It may be started from terminal by
sudo inputattach --daemon --intellimouse /dev/ttyS0 and starts in boot process having inputattach --intellimouse /dev/ttyS0 line in /etc/rc.local



This is correct, but I failed to find a method for automatic restart after wake up from suspend. By proposition for other serial device I added 99_sermouse_restart executable script to /lib/systemd/system-sleep/ folder with content



#!/bin/bash
# suspend_inputattach() {
# inputattach automatically stops on suspend, so no need
# usr/sbin/inputattach
#}
echo "Elindult..." > /tmp/inputattach_teszt
resume_inputattach() {
echo "most ugrik..." >> /tmp/inputattach_teszt
# restart input attach program
# sleep 10s && inputattach --daemon --intellimouse /dev/ttyS0
# sleep 10s && inputattach --intellimouse /dev/ttyS0 &
killall inputattach && sleep 10s && inputattach --intellimouse /dev/ttyS0 &
# inputattach --intellimouse /dev/ttyS0 &
#echo "ugrott..." >> /tmp/inputattach_teszt
}

case "$1" in
post)
resume_inputattach
#echo "benne volt..." >> /tmp/inputattach_teszt
;;
*)
echo "nincs benne..." >> /tmp/inputattach_teszt
;;
esac
echo $? >> /tmp/inputattach_teszt
echo "befejezte..." >> /tmp/inputattach_teszt

exit $?


By /tmp/inputattach_teszt



Elindult...
most ugrik...
0
befejezte...


it is obvious, inputattach in it runs with no error, but the mouse doesn't work (have to be activated by the described terminal command). I made trials with modification of inputattach line of the script, but with no success (some of them are in the script as comments).



I found the slices of log (/var/log/Xorg.0.log) generated before, during and after inputattach. The last lines before it (from previous suspend) were removing mouse and its module. iputattach itself generated lines describing the attach process. The later steps of wake up added end of its usability:



[ 62187.541] (II) config/udev: removing device Microsoft MZ Mouse 
[ 62187.560] (II) evdev: Microsoft MZ Mouse: Close
[ 62187.561] (II) UnloadModule: "evdev"


I am afraid, the script runs earlier then it would be optimal.



My questions: (1) how to put the script into a later point of resume, or (2) how to avoid the last described step of wake up? Thank you.







mouse suspend wakeup






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 19 at 19:34







HGI

















asked Jan 17 at 7:42









HGIHGI

12




12













  • I GAVE UP. In the narrow sense this topic would not worth the energy invested (there are RS232 connectors on the very old machines only, and after wake up the serial mouse may be started by a single command). I wanted to understand a part of the UBUNTU: how to force the system to start a daemon automatically when it wakes up. I failed.

    – HGI
    Feb 1 at 20:57



















  • I GAVE UP. In the narrow sense this topic would not worth the energy invested (there are RS232 connectors on the very old machines only, and after wake up the serial mouse may be started by a single command). I wanted to understand a part of the UBUNTU: how to force the system to start a daemon automatically when it wakes up. I failed.

    – HGI
    Feb 1 at 20:57

















I GAVE UP. In the narrow sense this topic would not worth the energy invested (there are RS232 connectors on the very old machines only, and after wake up the serial mouse may be started by a single command). I wanted to understand a part of the UBUNTU: how to force the system to start a daemon automatically when it wakes up. I failed.

– HGI
Feb 1 at 20:57





I GAVE UP. In the narrow sense this topic would not worth the energy invested (there are RS232 connectors on the very old machines only, and after wake up the serial mouse may be started by a single command). I wanted to understand a part of the UBUNTU: how to force the system to start a daemon automatically when it wakes up. I failed.

– HGI
Feb 1 at 20:57










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110487%2finputattach-after-waking-from-suspend%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110487%2finputattach-after-waking-from-suspend%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕