Git Product home page Git Product logo

paas-nginx-hosts-reload's Introduction

paas-nginx-hosts-reload

nginx-hosts-reload is a Go project that monitors changes in the /etc/hosts file and reloads the nginx process when changes are detected.

Features

  • Monitors the /etc/hosts file for changes
  • Sends a SIGHUP signal to the nginx process when changes are detected
  • Provides a simple API to start and stop the monitoring process

Usage

To run Nginx Hosts Reload, you must compile the code and run the binary file.

go build
./nginx-hosts-reload

By default, the utility will run in the background and check the modification time of the /etc/hosts file every 5 seconds. The nginx process name and the "master process" cmd substring will be used to find the nginx process ID.

Options

  • -log-level: Specify the log level (default: info)
  • -interval: Specify the interval for checking the hosts file for changes (default: 5s)
  • -process-name: Specify the process name to check (default: nginx)
  • -cmd-substring: Specify the cmd substring to check (default: master process)

Makefile

The Makefile has several options:

  • build: Builds the Go project and creates a binary in the bin directory.
  • build_amd64: Builds the Go project for the Linux, AMD64 architecture and creates a binary in the bin directory.
  • test: Runs vet, unit, and integration targets.
  • vet: Runs Go's vet tool to check for suspicious constructs in the source code.
  • unit: Runs unit tests on the project.
  • integration: Builds a Docker image and runs integration tests.
  • image: Builds a Docker image using the Dockerfile in ci/docker directory.
  • docker_start: Starts a Docker container with the previously built Docker image and copies the binary to the container.
  • docker_stop: Stops and removes the Docker container.
  • docker_exec: Runs a bash shell inside the Docker container.
  • bosh_release: Creates a BOSH release tarball from the project source code.
  • gh_actions: Runs the act tool to emulate github actions locally.
  • clean: Deletes the bin directory, the bosh-release-tarballs directory, and some other generated files.

Contributions

Contributions are welcome. Please open a pull request or issue for any bugs or feature requests.

paas-nginx-hosts-reload's People

Contributors

corlettb avatar dark5un avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.