This repository was archived by the owner on Sep 8, 2024. It is now read-only.
{start,stop}-mycroft.sh: allow system-wide setups#2687
Closed
PureTryOut wants to merge 3 commits intoMycroftAI:devfrom
PureTryOut:start-stop-systemwide
Closed
{start,stop}-mycroft.sh: allow system-wide setups#2687PureTryOut wants to merge 3 commits intoMycroftAI:devfrom PureTryOut:start-stop-systemwide
PureTryOut wants to merge 3 commits intoMycroftAI:devfrom
PureTryOut:start-stop-systemwide
Conversation
|
Voight Kampff Integration Test Succeeded (Results) |
PureTryOut
commented
Sep 6, 2020
ShellCheck is a static analysis tool for shell scripts with the goal to: - point out and clarify typical beginner's syntax issues that cause a shell to give cryptic error messages - point out and clarify typical intermediate level semantic problems that cause a shell to behave strangely and counter-intuitively - point out subtle caveats, corner cases and pitfalls that may cause an advanced user's otherwise working script to fail under future circumstances I've ran this tool over both start-mycroft.sh and stop-mycroft.sh and fixed any issue that popped up
This makes the start and stop scripts compatible with POSIX shells. Overview of the changes: - "function" statements removed, not necessary and incompatible - dashes in function and variable names for lower ones (- to _) - source statements changed for . - double square brackets replaced for single ones - double equal statements replaced for single ones - &> (piping stdout and stderr to the same file) replaced for 2>&1 > - sourcing of mycroft-skill-testrunner replaced with direct execution with Bash - replaced BASH_SOURCE with $0, these scripts are never sourced anyway - replaced "echo -n" statements with "printf" - merged the "" and "all" cases to a single one
In case of Linux distributions, MyCroft will be installed system-wide and a git checkout is not available. Without this change, start-mycroft.sh and stop-mycroft.sh however expect that git checkout to be available and it won't launch the services without it. Modify the script to check if it's being ran systemwide, and if so skip the usual checks and steps that come to play when running in a git checkout. This way these scripts can be used to start and stop MyCroft services from distribution installed packages, assuming these scripts are installed as `start-mycroft` and `stop-mycroft`.
|
Voight Kampff Integration Test Failed (Results) |
|
Voight Kampff Integration Test Succeeded (Results) |
fermulator
suggested changes
Oct 9, 2020
| @@ -1,4 +1,4 @@ | |||
| #!/usr/bin/env bash | |||
Contributor
There was a problem hiding this comment.
BLOCKED by https://github.com/MycroftAI/mycroft-core/pull/2686/files
(pending that, then a rebase or merge to update - then we can review this diff a little more cleanly)
Contributor
Author
|
I have different plans to do system-wide (and per-user) setups actually. Closing this in favour of a new PR soon to come. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This allows
start-mycroft.shandstop-mycroft.shto start and stop MyCroft when it's installed system-wide, assuming the files are installed asstart-mycroftandstop-mycroft(so without the.shextension). This is especially useful for distribution packaging which won't have a git checkout with the source and a virtualenv available and can probably be used for Pip as well.Note that this PR depends on #2686 and shouldn't be merged without it. I'll rebase this PR on the latest
devwhen #2686 is merged.How to test
Install MyCroft system wide (e.g.
python3 setup.py install --prefix=/usr --root=/, make sure you have all the deps installed system-wide!), copy/renamestart-mycroft.shtostart-mycroftand optionally put it in/usr/bin. Then just runstart-mycroft all. Do the same forstop-mycroft.sh.Contributor license agreement signed?
CLA [x] (Whether you have signed a CLA - Contributor Licensing Agreement
Fixes #2191