fix gpm command line

The gpm runscript quotes some computed command line options when it shouldn't, meaning they get parsed as a single argv entry, producing a confusing error message, failing and constantly attempting to restart.

Logs below are with logging hacked in, they don't actually feature in the runscript before or after:

Before

2024-10-26_14:30:27.36136 invoke-run: starting gpm
2024-10-26_14:30:27.36138 /usr/sbin/gpm -D  -m /dev/input/mice -t exps2
2024-10-26_14:30:27.36285 *** debug [daemon/init_mice.c(46)]: finished initialization
2024-10-26_14:30:27.36287 O0o.oops(): [daemon/old_main.c(54)]: Please use -m /dev/mouse -t protocol
2024-10-26_14:30:27.36287 *** debug [daemon/gpm_exited.c(30)]: Removing files /var/run/gpm.pid and /dev/gpmctl
2024-10-26_14:30:27.36290 *** info [daemon/startup.c(131)]: Started gpm successfully. Entered daemon mode.
2024-10-26_14:30:28.42770 invoke-run: starting gpm
2024-10-26_14:30:28.42777 /usr/sbin/gpm -D  -m /dev/input/mice -t exps2
2024-10-26_14:30:28.43061 *** debug [daemon/init_mice.c(46)]: finished initialization
2024-10-26_14:30:28.43066 O0o.oops(): [daemon/old_main.c(54)]: Please use -m /dev/mouse -t protocol
2024-10-26_14:30:28.43067 *** debug [daemon/gpm_exited.c(30)]: Removing files /var/run/gpm.pid and /dev/gpmctl
2024-10-26_14:30:28.43073 *** info [daemon/startup.c(131)]: Started gpm successfully. Entered daemon mode.

After

2024-10-26_14:33:05.27432 invoke-run: starting gpm
2024-10-26_14:33:05.27438 /usr/sbin/gpm -D -m /dev/input/mice -t exps2
2024-10-26_14:33:05.27517 *** debug [daemon/add_mouse.c(51)]: adding mouse device: /dev/input/mice
2024-10-26_14:33:05.27519 *** debug [daemon/add_mouse.c(100)]: adding mouse type: exps2
2024-10-26_14:33:05.27532 *** debug [daemon/init_mice.c(39)]: initialize /dev/input/mice with proto exps2
2024-10-26_14:33:05.27532 *** debug [daemon/init_mice.c(46)]: finished initialization
2024-10-26_14:33:05.88038 *** debug [daemon/get_console_size.c(45)]: Screen size: 160 - 50
2024-10-26_14:33:05.88044 *** debug [daemon/get_console_size.c(62)]: x 10, y 20
2024-10-26_14:33:07.88272 *** debug [daemon/old_main.c(156)]: selected 0 times

Unfortunately the daemon conflates "not daemonizing" with "showing all your debug". It would be nice to patch gpm to separate the two modes. This could also improve the systemd unit file which currently deploys a forking service (with a sleep!) which might make such a patch more appealing.

Merge request reports

Loading