https://github.com/hongquan/wait-server
Tool to wait for a server to be online
https://github.com/hongquan/wait-server
made-in-vietnam process-scheduling systemd-service
Last synced: over 1 year ago
JSON representation
Tool to wait for a server to be online
- Host: GitHub
- URL: https://github.com/hongquan/wait-server
- Owner: hongquan
- Created: 2019-03-12T07:23:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T17:37:39.000Z (over 7 years ago)
- Last Synced: 2025-01-29T17:44:55.008Z (over 1 year ago)
- Topics: made-in-vietnam, process-scheduling, systemd-service
- Language: Shell
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wait-server
Tool (as Bash script) to wait for a server to be online (connectable), in a certain duration.
## Usage
```
wait-server 8000
```
is to wait for a server at port 8000, on localhost to be online. After 5 seconds, the program will exit with error.
Full options:
```
wait-server [[HOST] PORT] [-t ][-q][-h]
```
where:
- `HOST`: Host name or IP address of server. Default is localhost.
- `PORT`: Port where the server is listening. Default is 8000.
- `t`: Timeout. Default is 5s.
- `q`: Quiet, don't show progress dots.
Main purpose of this tool, is to be used in a _systemd_ service, to delay the service until some server is online. For example, you have `service-a` and `service-b`, in which `service-a` is a server software that takes long time to initialize (often Java application), and `service-b` should be run only after `service-a` is ready. You can write the _systemd_ service file like this:
```ini
[Unit]
After=service-a.service
[Service]
ExecStartPre=/usr/bin/wait-server
ExecStart=/usr/bin/application-b
```
The mainpage documentation is to be generated by [pandoc](http://pandoc.org).