-
Notifications
You must be signed in to change notification settings - Fork 27
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
Rewrite of entry.sh to make it more robust and modular #139
Conversation
Nice, There seems to be a bug, maybe more, in the script. One i already fixed to get it working local. |
Thanks, |
The build check only verify if the container starts proper and ist healthy. The functions of the entry.sh script are not tested currently. I changed the entry.sh this a little bit and added a svn checkout during startup. To get some options to test the functions in the entry script, i looked at the bats-core projekt. |
- extra stage for adding tests via bats - copy FHEM src removed from dockerfile
- do not startFHEM if no argument is provided
I figured out, that there are some changes in the entry.sh script. As i understand, the attributes for the logfile are not changed, this is now a read only operation. So no changes will be done. I figured out, that the telnetdefinition was missing, so i added code to apply the definition if it does not exists on the specified port. |
@sidey79 PS: Sorry for being a bit unresponsive, but real job, family … |
Currently, the healthcheck isn't working without a telnet device. May we can patch this. |
I was now thinking back and forth if it's wise to get rid of the telnet device. My conclusions:
But I would suggest the following improvements: Your opinion? |
The telnet device itself is only used, to query all the fhemweb devices.
The only option i see is, that we can create a separate telnet device, without an password but with filter towards localhost.
I was thinking about this also, and added the telnet device explicit for docker with a meaningfull name, if there is no telnet device already present at the port, it will be created. We don't need to expose this port or allow others as localhost.
I was thinking about the same, that querying the fhemweb devices every 10 seconds is not needed.
May we can make the first step, of writing a static file which is used by the healthcheck script doing it's work and then adapt the health_check script working with that file. There is an option, extending the 98_DockerInfo.pm writing this Information at FHEM start. This way it should be very easy to provide an up to date information about the fhemweb devices to use for the healthcheck. It would be great if you make a proposal of this file. |
Very good idea. I just committed a new health-check.sh and a corresponding 98_DockerInfo.pm.
This way we completely get rid of the telnet in the health-check.sh, and even the config-file parsing in health-check.sh is not needed any more. This makes it even suitable for setups using a db. |
I started adding some tests via bats. There is one test "check setGlobal_LOGFILE from fhem.cfg" i think, the result for this test is not correct, but i was not able to identify why. |
a6c84ac
to
0fadb3b
Compare
db48332
to
18ee620
Compare
chown ${FHEM_UID}:${FHEM_GID} "$realLogFile" | ||
tailFileToConsoleStart "$realLogFile" # Start writing the logfile to the console | ||
|
||
# setTelnet_DEFINITION |
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.
I disabled the creation of a telnet device for docker, because i think with this improved healh check this is not needed anymore
70c1a89
to
02a615a
Compare
After having a number of regressions esp. on logging to the console, I decided to make a rewrite of the script.
Please consider my changes, sorry for them being so massive.
I'm open for any question/discussion.
Thx in advance.