Commit Graph

13 Commits (391b92ce567a8366a5d70529eb7bf86d83f07e0c)

Author SHA1 Message Date
Steve Penrod dd697cb765 Tweaks to start/stop scripts
Several minor changes:
* Add mycroft-start and mycroft-stop, which can be used as commands anywhere
  if the user has added this to the PATH.  They are shortcuts to the
  start-mycroft.sh and stop-mycroft.sh scripts.
* Add to the mycroft-help command reference
* Add "reset" parameter for start-mycroft.sh, which forces a service restart.
  If a service is currently running, it will not restart by default anymore.
* Make the 'enclosure' service part of 'all' regardless of platform.  This
  makes sense not that it can handle a remote GUI connection.
* BUG: mycroft-stop would sometimes show odd messages if the skill process
  had active child processes.
2019-01-15 09:08:13 +01:00
Steve Penrod 5e6c1773e4
Unify the command line experience across platforms (#1784)
* Unify the command line experience across platforms

Interacting with Mycroft was slightly different on different platforms
(Mark 1, Github, Picroft), which resulted in confusion and the beginnings of a
documentation/support nightmare.  This moves several of the common commands
into a mycroft-core/bin folder instead of being build in packaging or part
of the Picroft package only.

This required a small changes to the common scripts, in addition to adding
the new scripts.  Here are details:
* dev_setup.sh
  - Stubbed out a setup wizard (TODO)
  - Jumped to latest version of pip (18.0)
  - Set execution flags for new scripts
* start-mycroft.sh
  - Allow auto-execution of dev_setup.sh
  - De-sourced the stop-mycroft.sh calls (not needed)
  - Add quotes to better handle paths with spaces
* stop-mycroft.sh
  - Return exit code to show if a service was stopped or killed
  - Extend the time to wait for a gently shutdown from 2 secs to 5
  - Changed to say "messagebus.service" instead of just "service" to be more clear (the name "service" means nothing to users, but "bus does")
* venv-activate.sh
  - Added help
  - Added -q or --quiet mode
  - Added toggled availability of 'mycroft-venv-activate' and 'mycroft-venv-deactivate' aliases.  Only one is available at any given time.

New scripts:
* mycroft-cli-client: start up the CLI
* mycroft-help: shows hints on using mycroft
* mycroft-mic-test: runs the basic record/playback, playing nicely with a running Mycroft by stopping and restarting services as appropriate
* mycroft-pip: manage the venv via pip
* mycroft-say-to: send utterances, like a user spoke them
* mycroft-speak:  speaks the given phrase using Mycroft
* mycroft-skill-testrunner: invoke the single-skill test runner

All of these scripts are easy to discover by typing "mycroft-" then
hitting the TAB key.

==== INSTALLER NOTES ====
* We no longer need to create mycroft-cli-client and mycroft-pip in the Debian packages.
* mycroft-core/bin should be added to the path

* Corrections after review

Several minor corrections, plus added wrappers for the 'msm' and 'msk'
utilities.

* Set executable flag on script files in bin/

The scripts in the bin/ folder needed to be changed to executable within
git to prevent looking dirty after dev_setup.sh has been run.

* Add executable flag to one more script
2018-09-09 16:55:01 -05:00
Åke Forslund a66e23d8ab start processess using python -m
- rename process main.py to __main__.py
- update start-mycroft.sh/stop-mycroft.sh scripts to reflect the change
2018-08-16 15:21:22 +02:00
Steve Penrod 5b8a018766 Remove unused DIR variable 2018-08-15 17:19:30 -05:00
Steve Penrod 684230213e Set the directory explicitly start-mycroft.sh scripts
Explicitly setting the directory at the beginning of the start-mycroft.sh
and stop-mycroft.sh scripts.  The behaves better if invoked from a
different directory.
2018-08-15 03:50:37 -05:00
Steve Penrod f329051743 Move logs to /var/log in all cases
Previously, the location of the log files changed depending
on whether you were running on a Mark1/Picroft or under a
"Github" install.  Now they are always under the same directory
at /var/log/mycroft-*.log

This also updates the CLI to pull from that location always.

Additionally:
* Removed the nonfunctional 'wifi' option from start-mycroft.sh
* Made the validation for dev_setup.sh exit instead of just show
  a warning message in start-mycroft.sh
* Added code to allow dev_setup.sh to be run from different
  directories successfully
2018-08-02 21:21:30 -05:00
Julien Kassar ed556b09df Standardize shell scripts (#1711)
* Standardize shebangs
* Standardize spaces
* Standardize functions declaration
* Standardize conditional constructs
* Standardize double quotes
* Standardize command substitution
* Standardize sed command
2018-08-02 14:48:47 -05:00
Steve Penrod 365d6d19a0 Add enclosure to the start/stop dev scripts
The start-mycroft.sh and stop-mycroft.sh scripts now automatically
run the enclosure client if the platform is defined as
"mycroft_mark_1".

Also corrected a copy/pasted comment and added a clarifying message during the stop when killing a process.

Add stop support for recent 'python3' change

Necessary after #1703

The -r option eliminates the quotes on output

Clean up the usage of jq, -r removes the quotes on output.  Also eliminated the python2 support in the regex ```[p]ython[2|3]``` and dropped the unnecessary ```[p]```.

Verify platform file existence before read

It might not exist on a desktop install.

Verify platform file existence before read
2018-07-27 15:48:08 -05:00
Matthew D. Scholefield 10bd9a1cf3 Change initial kill to SIGINT
This sends a ctrl+c signal to each process which will allow code to exit properly by handling KeyboardInterrupt
Other notable changes:
 - create_daemon method used to clean up create daemon threads
 - create_echo_function used to reduce code duplication with messagebus
 echo functions
 - wait_for_exit_signal used to wait for ctrl+c (SIGINT)
 - reset_sigint_handler used to ensure SIGINT will raise KeyboardInterrupt
2018-04-11 21:29:10 -05:00
Åke Forslund d6c5c5c30e Add "all" option to stop-mycroft.sh
Adding the "all" option makes the syntax for stop-mycroft.sh mirror the syntax
for start-mycroft.sh
2017-11-09 10:41:24 -06:00
Rhett Aultman 35c3af1e2c Make mycroft-core.sh invocable from outside
mycroft-core.sh has a relative-path call (that itself also likes to
be called from inside mycroft-core) that prevents making a clean start
of mycroft from outside the mycroft-core directory.  This makes doing
things like adding it as a Ubuntu Unity startup application slightly
messy.
2017-10-26 19:06:11 -04:00
Steve Penrod 37a798385e Remove unused variable noticed by Codacy
Removed the unused exit_code variable
2017-09-28 01:08:20 -05:00
Steve Penrod 07992b49d5 Revamping the scripts used to start/stop Mycroft
Reworking the mechanisms used to interact with Mycroft.  The old
mycroft.sh utilized the 'screen' command, but now with the CLI it
it easier to use that for viewing log files.  Plus there was
confusion between when to use start.sh and when to use mycroft.sh.

Now things are wrapped in the simple and easily discoverable scripts:
* start-mycroft.sh
* stop-mycroft.sh

The start-mycroft.sh allows you to start the background services and
to invoke the various tools (e.g. the CLI, unit tests, etc).

==== Fixed Issues ====

====  Documentation Notes ====
This will require revamp of the getting started guides, etc.
2017-09-28 01:08:20 -05:00