LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-04-2019, 07:56 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,046

Rep: Reputation: 59
Restarting gpm, the mouse server.


Hi: After 'gpm -k' the mouse is disabled. Now, if I need it again, I do gpm restart, acording to /etc/rc.d/rc.gpm. But it isn't enabled again! Possible cause? Perhaps disabling it with 'gpm stop'?

I made 'gpm -m /dev/mouse -t imps2 and it restarted! Why 'gpm restart' has no effect?

Last edited by stf92; 05-04-2019 at 08:01 PM.
 
Old 05-04-2019, 09:54 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,267

Rep: Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629
Why did you try "restart" on something that you knew was stopped?
 
Old 05-05-2019, 08:37 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,046

Original Poster
Rep: Reputation: 59
/etc/rc.d/rc.gpm takes a parameter which can be stop, restart or start.
 
Old 05-07-2019, 11:47 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,959

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
It could be an issue in what happens when gpm -k is run when the program is already killed. It doesn't make much sense to me, but in the future, you could try running /etc/rc.d/rc.gpm start directly if restart doesn't work to see if that allows it to function again.
 
Old 05-07-2019, 06:24 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,046

Original Poster
Rep: Reputation: 59
gpm stop should stop the mouse (touchpad) and gpm restart should restart it..
 
Old 05-07-2019, 06:42 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,959

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
If you look at the rc script, restart contains the same command as the stop and start commands. In theory, running restart should work to start the command, but apparently it didn't work. That's why I asked to see if running start made a difference, because the start and the restart command both run gpm -m /dev/mouse -t imps2 which did work to start the server up again.

But, the script commands are stop to stop it, start to start it, and restart to stop and then to start it. "Restart" is designed to be used when it is running to restart the program (you can't restart a computer if it is shut down).

As I said above, restart should work, but since it didn't, I'm wondering if start works instead.
 
Old 05-07-2019, 06:56 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,046

Original Poster
Rep: Reputation: 59
I'll have to wait till the computer is back from the repair man. It can't be turned on. That will be tomorrow, I think.
 
Old 05-07-2019, 09:24 PM   #8
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 3,267

Rep: Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629Reputation: 1629
Quote:
Originally Posted by stf92 View Post
/etc/rc.d/rc.gpm takes a parameter which can be stop, restart or start.
Running
Code:
/usr/sbin/gpm -k
results in a non-zero return code.

IF you have run
Code:
set -e
in your environment, then that non-zero return code will stop the script from continuing.

Running
Code:
/usr/sbin/gpm -k
followed by
Code:
/usr/sbin/gpm -k ; sleep 1 ; echo "Hi"
will let you know if that's the case.

If you see "Hi" on the terminal, the
Code:
/etc/rc.d/rc.gpm restart
command would not stop after the attempt the kill the non-running daemon. If you do not see "Hi" on the terminal, the restart command would fail.
 
1 members found this post helpful.
Old 05-14-2019, 06:08 PM   #9
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,046

Original Poster
Rep: Reputation: 59
All I say is that
Code:
/usr/sbin/gpm stop
should stop the mouse. But it doesn't.
 
Old 05-14-2019, 06:17 PM   #10
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 5,080
Blog Entries: 11

Rep: Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016Reputation: 3016
Quote:
Originally Posted by stf92 View Post
All I say is that
Code:
/usr/sbin/gpm stop
should stop the mouse. But it doesn't.
Why do you think it should work that way? What does man gpm have to say?

Last edited by astrogeek; 05-14-2019 at 06:22 PM.
 
Old 05-14-2019, 08:51 PM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,959

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
Quote:
Originally Posted by stf92 View Post
All I say is that
Code:
/usr/sbin/gpm stop
should stop the mouse. But it doesn't.
That's not a valid argument for the command. Now, if you run /etc/rc.d/rc.gpm stop and that doesn't stop the mouse, it might be worth looking into. But that command should run:

Code:
/usr/sbin/gpm -k
...which is a valid option for the command and should stop the server.

As I said above, running /etc/rc.d/rc.gpm restart should "stop" and then "start" the gpm server, but if restart doesn't work, I was curious if "stop" works...
 
Old 05-15-2019, 06:15 PM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,046

Original Poster
Rep: Reputation: 59
The machine is still at the repair man house, sorry. Anyway, as there is the -k option for gpm there should also be an option to restart it. But there is not. To have to run /etc/rc.d/rc.gpm restart is awkward. The slackware machine will be in my power in a few days.
 
Old 05-15-2019, 08:53 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,959

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
Quote:
Originally Posted by stf92 View Post
The machine is still at the repair man house, sorry. Anyway, as there is the -k option for gpm there should also be an option to restart it. But there is not. To have to run /etc/rc.d/rc.gpm restart is awkward. The slackware machine will be in my power in a few days.
gpm is the binary provided by the program. Slackware has no control over that and what flags/options it supports. /etc/rc.d/rc.gpm is provided by Slackware to control gpm (mostly) on startup). This file should support start, stop, and restart. If you look at the script, you can see what it does:

Code:
if [ "$1" = "stop" ]; then
  echo "Stopping gpm..."
  /usr/sbin/gpm -k
elif [ "$1" = "restart" ]; then
  echo "Restarting gpm..."
  /usr/sbin/gpm -k
  sleep 1
  /usr/sbin/gpm -m /dev/mouse -t imps2
else # assume $1 = start:
  echo "Starting gpm:  /usr/sbin/gpm -m /dev/mouse -t imps2"
  /usr/sbin/gpm -m /dev/mouse -t imps2
fi
So, if it's passed "stop", it will run /usr/sbin/gpm -k, if it's passed "start", it will run /usr/sbin/gpm -m /dev/mouse -t imps2, and if it's passed restart, it will run /usr/sbin/gpm -k, followed by a 1 second pause, and then /usr/sbin/gpm -m /dev/mouse -t imps2 to start it back up. If this script is not working, that's the only thing Pat can tweak. That's what we need to test.

If you think gpm should support a stop flag, you'd need to get with the developers of gpm and see if they're willing to add support for that.

I did test running /etc/rc.d/rc.gpm stop and it successfully stopped the process (although, my mouse still worked, but I'm too lazy to research why, although, it's probably a simple reason). Then I ran /etc/rc.d/rc.gpm restart (which should try and kill the gpm process and then start it again). I got an error that it couldn't kill the program (since it was already killed) and then it successfully started gpm again.

Code:
root@craven-moorhead:~# /etc/rc.d/rc.gpm stop
Stopping gpm...
root@craven-moorhead:~# ps -ef | grep gpm
root     21316 16974  0 19:52 pts/1    00:00:00 grep gpm
root@craven-moorhead:~# /etc/rc.d/rc.gpm restart
Restarting gpm...
O0o.oops(): [daemon/check_kill.c(38)]: Could not open /var/run/gpm.pid.
root@craven-moorhead:~# ps -ef | grep gpm
root     21321     1  0 19:52 ?        00:00:00 /usr/sbin/gpm -m /dev/mouse -t imps2
root     21324 16974  0 19:52 pts/1    00:00:00 grep gpm
So, from my end, the rc.gpm script seems to be working as expected.

Last edited by bassmadrigal; 05-15-2019 at 08:55 PM.
 
1 members found this post helpful.
Old 05-16-2019, 06:03 PM   #14
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,046

Original Poster
Rep: Reputation: 59
Thanks bassmadrigal. I hope I will have the machine soon.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] gpm working erratically since upgrade to gpm-1.20.7-i486-3 RandomTroll Linux - Software 2 08-15-2014 11:53 PM
gpm no ./configure gpm-1.20.7 EDDY1 Linux From Scratch 4 11-19-2012 05:34 PM
gpm don't have rc.gpm script rudsonalves Slackware 3 08-26-2012 08:45 AM
[SOLVED] gpm-1.20.6-make install-gpm error janakiramulu Linux From Scratch 12 05-12-2011 02:00 AM
GPM mouse server fails on boot startup and disables keyboard!! linuxgeek01 Linux - General 1 10-30-2006 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration