gersilex / apcupsd-docker

apcupsd in a container; can trigger arbitrary commands on the Docker host
https://hub.docker.com/r/gersilex/apcupsd
MIT License
25 stars 13 forks source link

Pull requests changes #4

Closed cassiorossi closed 3 years ago

cassiorossi commented 4 years ago

Hi Leroy, as you suggested, here is my pull request so you can review the code and understand better my changes.

In general, my motivation was to

  1. Listen all UPS trigger instead of only shutdown event - in order to handle it I used the netcat utility (docker-->host communication);
  2. Reuse my existing acpupsd scripts (using the same name) - in order to handle it I changed the host-trigger-check.sh to call an script with the same name of the UPS event
  3. Created a script to start, stop and rebuild the docker to make easier to rebuild it

I did not changed the README.md ...

Again, thanks a lot for your work, it help me a lot. Hope my changes give you good ideas!

Best regards,

Cássio

cassiorossi commented 4 years ago

Thank you for this. I really love how you turned the host-trigger-check.sh into a daemon with an event loop. I would never have thought of that.

Overall this looks really nice and I have added some minor questions and ideas in the review parts.

The environment makes a lot of assumptions (I think it depends on running on GNU/Linux and not having the GNU tools would probably not work, but I will test this later on my RancherOS machines). On the other hand - I think the userbase is quite small right now and probably consists mostly of linux users as Mac OSX users probably don't tinker a lot with apcupsd (please tell me if I'm wrong).

First of all, thanks a lot for your quick answer! Good to hear that you've liked! :)

I will take a look into your feedbacks and answer/change them as soon as possible!

Best regards,

Cássio Rossi

gersilex commented 3 years ago

We have come a long way and you added a lot of features. Thank you so much for extending the software!

I'll open a new issue for updating the Readme and we can tackle this whenever we feel like it.

cassiorossi commented 3 years ago

Leroy,

It was a great experience to work with you in this interaction. Learned a lot with it. So, thanks a lot for it!

Let's keep improving the project!

Best regards,

Cássio Rossi

Em dom, 11 de out de 2020 22:22, Leroy Förster notifications@github.com escreveu:

We have come a long way and you added a lot of features. Thank you so much for extending the software!

I'll open a new issue for updating the Readme and we can tackle this whenever we feel like it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gersilex/apcupsd-docker/pull/4#issuecomment-706806077, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTHG7NA4PVDIBTVOEGOPQLSKJK5HANCNFSM4RK36EMQ .