-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scripts for starting POCS automatically - WIP #475
Conversation
These scripts are designed for running: * ZeroMQ message forwarders * PAWS Web Server * PEAS Shell * POCS Shell They are each run in a separate terminal within tmux, a terminal multiplexer. These were originally developed for PAN008, and this PR is for making them more generally applicable. This is a WIP because I've not yet installed them on PAN008 and tested them.
Codecov Report
@@ Coverage Diff @@
## develop #475 +/- ##
===========================================
+ Coverage 67.9% 67.92% +0.01%
===========================================
Files 63 63
Lines 5449 5449
Branches 751 751
===========================================
+ Hits 3700 3701 +1
- Misses 1543 1544 +1
+ Partials 206 204 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this will be a good addition. Only thing I would recommend is to open a new window that tails the log file for pocs_shell.
Let me know how testing goes. I'll try it out on PAN001 and PAN001 as soon as I can.
of doing this varies on different versions of Unix/Linux. | ||
|
||
Next, we need to arrange for `su_panoptes.sh` to be executed when | ||
the operating system launches. First copy it to /etc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we symlink this in case it changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a security hole, as it allows the file to be changed without entering the password. For that reason, I prefer to copy it. The files that run as $PANUSER are not copied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, got it.
@@ -0,0 +1,11 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not the same as scripts/install/default-env-vars.sh
(which has your -z
additions)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I'm an idiot? I should have suggested that you document the file as intended to be modified to suit local conditions and then copied into /etc/profile.d/.
As it is, default-env-vars.sh
is well suited to running from $HOME/.profile at a point AFTER the user has provided any non-standard values.
sleep 10s | ||
tmux send-keys -t "${WINDOW}" "last_reading environment" C-m | ||
sleep 10s | ||
tmux send-keys -t "${WINDOW}" "last_reading weather" C-m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the first weather reading usually pulls across Undefined
for all the values which I suppose could cause alarm when shown here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How often do we get readings? 30 seconds? A minute? As it stands, it runs about 40 seconds after starting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first reading takes longer and comes back with the undefined values. I find it's usually about 2 minutes before any valid weather reading. Could just leave as is and we can watch it to see if it looks okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will leave as is.
log file, one from peas_shell, the other from pocs_shell.
|
||
tmux send-keys -t "${WINDOW}" "date" C-m | ||
tmux send-keys -t "${WINDOW}" "cd \"${PANLOG}\"" C-m | ||
tmux send-keys -t "${WINDOW}" "less --follow-name \"${LOGFILE}\"" C-m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I'll probably later submit a patch to this to add grc
in front of the less
(with appropriate checks if it exists) as I think its nice to have colorized log files. However that requires having a proper grc
config file since we don't show standard log messages.
One thing I like about byobu is the default status bar is much more helpful and user friendly. Will this display a status bar with names of windows? |
Linking #97. |
Yes, this will show the names of the windows, along with their numbers. I use ^B# (where # is the number of the window) to switch to a window. |
Submitting now, even as a WIP, so that it is easy to install on PAN006 for testing. |
These scripts are designed for running:
They are each run in a separate terminal within
tmux, a terminal multiplexer.
These were originally developed for PAN006, and this PR
is for making them more generally applicable.
This is a WIP because I've not yet installed them on
PAN006 and tested them.