Tiny Core Extensions > TCE Bugs

Issues with starting and stopping gpm via init.d

(1/1)

SamK:
TC: v4.7.5
gpm: OnBoot (default configuration used)

Following a reboot, commands run as root


Obtain status of gpm
--- Code: ---ps | grep gpm
... root     grep gpm
--- End code ---
gpm is not running.


Start gpm via init.d
--- Code: ---/usr/local/etc/init.d/gpm start
gpm is already running


ps | grep gpm
... root     grep gpm
--- End code ---
Expected message, "Starting gpm."
gpm is not running.


Start gpm at the command line using standard configuration
--- Code: ---gpm -m /dev/input/mice -t ps2


ps | grep gpm
... root     gpm -m /dev/input/mice -t ps2
... root     grep gpm
--- End code ---
gpm is running


Kill the X-server and load Midnight Commander. 
Mouse works as expected.


Stop gpm via init.d
--- Code: ---/usr/local/etc/init.d/gpm stop
Killed


ps | grep gpm
... root     grep gpm
--- End code ---
gpm successfully stopped.


Again stop gpm via init.d
--- Code: ---/usr/local/etc/init.d/gpm stop
Killed
--- End code ---
Expected message, "gpm was not running, no process killed."



Edit: added expected message

famousbirds:
Resurrecting this one since I have experienced this issue and have a fix:

The init.d/gpm script is broken on lines 9 and 27.

Currently it reads:


--- Code: (bash) ---if ps | awk '{print $3}' | grep -e "gpm" >/dev/null; then

--- End code ---

This is incorrect, since the script is also called "gpm"!  So it will find its own entry and abort.

Instead, the code should read:


--- Code: (bash) ---if ps | awk '{print $3}' | grep -e "/usr/local/sbin/gpm" >/dev/null; then

--- End code ---

This will ensure searching for current gpm processes identifies the actual gpm executable, not the init.d script.  This is in keeping with the many explicit references to /usr/local/sbin/gpm in the rest of the script.

Otherwise, gpm will never actually be started.  Spent a minute scratching my head over this one.

I am happy to submit this fix more formally - is posting in the forums the official method, or is there some place I can submit a pull request?

Thanks!

Misalf:
Aha! Thanks.

For submitting extensions see here:
http://wiki.tinycorelinux.net/wiki:creating_extensions#submission

famousbirds:
Ah thanks, submitted.

Greg Erskine:

--- Quote from: famousbirds on December 10, 2014, 03:58:22 PM ---Resurrecting this one since I have experienced this issue and have a fix:

The init.d/gpm script is broken on lines 9 and 27.

Currently it reads:


--- Code: (bash) ---if ps | awk '{print $3}' | grep -e "gpm" >/dev/null; then

--- End code ---

This is incorrect, since the script is also called "gpm"!  So it will find its own entry and abort.

Instead, the code should read:


--- Code: (bash) ---if ps | awk '{print $3}' | grep -e "/usr/local/sbin/gpm" >/dev/null; then

--- End code ---

This will ensure searching for current gpm processes identifies the actual gpm executable, not the init.d script.  This is in keeping with the many explicit references to /usr/local/sbin/gpm in the rest of the script.

Otherwise, gpm will never actually be started.  Spent a minute scratching my head over this one.

I am happy to submit this fix more formally - is posting in the forums the official method, or is there some place I can submit a pull request?

Thanks!

--- End quote ---

hi famousbirds,

I think I have solved a similar situation by adding "| grep -v grep |".

regards
Greg

Navigation

[0] Message Index

Go to full version