[Pkg-gpm-devel] Bug#298197: /etc/init.d/gpm start needs to be called twice

Peter Samuelson Peter Samuelson <peter@p12n.org>, 298197@bugs.debian.org
Mon, 4 Apr 2005 16:40:03 -0500


--10jrOL3x2xqLmOsH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


[Helge Kreutzmann]
> If you tell me where I should experiment, I could try out to add a
> delay. I noticed, that sometimes a simple call of "gpm start" is
> enough, so it indeed seems to be a timing issue (but I could not
> detect a pattern, so maybe background activity or somthing like
> this).

This is the hack I'm considering for /etc/init.d/gpm.  If you'd like to
try it and report back, that'd be great.

An alternative solution would be to load the 'mousedev' kernel module
in /etc/modules or /etc/modules-2.6 (if you have the latter).

I don't intend to hack the gpm binary itself, just the init script.
This isn't really gpm's bug, so there are limits in how far I'm willing
to go to work around it. (:

Peter

--- /etc/init.d/gpm	2004-08-25 14:52:41.000000000 -0500
+++ /etc/init.d/gpm	2005-04-04 16:33:22.000000000 -0500
@@ -44,6 +44,13 @@
=20
 gpm_start () {
   echo -n "Starting mouse interface server: gpm"
+  # HACK - kernel module init is asynchronous in kernel 2.6, EVEN FROM
+  # REQUEST_MODULE().  That would include 'mousedev'.  Bleh.  Messing
+  # with hotplug scripts is way too much trouble, though, hence this.
+  for foo in 1 2 3; do
+    if :< ${device-/dev/mouse}; then break; fi
+    sleep 1
+  done
   eval start-stop-daemon --start --quiet --nicelevel $niceness --exec $GPM=
 \
     -- $cmdln || { echo " start failed."; return 1; }
   echo "."

--10jrOL3x2xqLmOsH
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCUbQzXk7sIRPQRh0RAngWAKCt+DJa590tXRqE1AEQJC2N0RyRXQCaA6z5
o2ctnDCHFCLfnbXShsRcCME=
=0c08
-----END PGP SIGNATURE-----

--10jrOL3x2xqLmOsH--