After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748708 - Need a better command-line interface
Need a better command-line interface
Status: RESOLVED WONTFIX
Product: mousetrap
Classification: Other
Component: General
3.17.x
Other Mac OS
: Normal enhancement
: ---
Assigned To: mousetrap-maint
mousetrap-maint
gnome[unmaintained]
Depends on:
Blocks: 710774
 
 
Reported: 2015-04-30 13:50 UTC by Stoney Jackson
Modified: 2018-08-17 19:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stoney Jackson 2015-04-30 13:50:04 UTC
... that is flexible for use by a GUI later.


CURRENTLY
---------

This is the current way mousetrap is started and stopped.

```
$ mousetrap
... (status/debug output)
^C
... (ugly exception stuff)
$
```

Even after that, the user have to kill the mousetrap process.

```
$ ps aux | grep mousetrap
$ kill -9 12345
```

1. Users shouldn't have to deal with exceptions when performing a common operation like stopping mousetrap, unless there really is a problem.
2. Users shouldn't have to use kill to stop mousetrap.


PROPOSAL
--------

I recommend allowing MouseTrap to be controlled through the System V `service` command. For example

```
$ service mousetrap start
$ service mousetrap restart
$ service mousetrap stop
$ service mousetrap status
```

There are several advantages to this approach.

* Users, external applications, and MouseTrap itself can more easily start, restart (reload configuration), and stop MouseTrap.
* MouseTrap could be installed as a service to run on start up.
* External applications that know how to control applications through services can also control MouseTrap.
* MouseTrap itself could use this interface to control itself, including reloading configuration. This would provide an interface through which a GUI component (for example) could control MouseTrap.
* MouseTrap's design would improve because it would have to handle POSIX signals appropriately.
* The service script could be expanded to provide other functionality. E.g., a soft reload that would just reload the configuration, vs. a full reset which would reload the configuration and reset all components, etc.



INITIAL TO-DO LIST
------------------

1. Implement support for signals in existing MouseTrap application.
2. Implement a System V service script.
3. Make appropriate adjustments to setup.py and/or Makefile.am to install MouseTrap as a service.
4. Update README.md to reflect the new methods for controlling MouseTrap.
Comment 1 Stoney Jackson 2015-05-29 03:08:47 UTC
SysV is outdated. systemd appears to be the way to go. 

New to-do list:

1. Implement support for SIGTERM (shut down) and SIGHUP (reload configuration)
2. Write a systemd unit file
3. Update autotool scripts to check for systemd and install unit file
4. Update README with instructions for controlling moustrap via systemd


References
http://www.freedesktop.org/software/systemd/man/daemon.html
http://www.freedesktop.org/wiki/Software/systemd/
Comment 2 André Klapper 2018-08-17 19:46:00 UTC
mousetrap is not under active development anymore since 2015.
Its codebase has been archived:
https://gitlab.gnome.org/Archive/mousetrap/commits/master

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Please feel free to reopen this ticket (or rather transfer the project
to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the
responsibility for active development again.