Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathan-osman/hang
Extremely simple Linux application that hangs until a signal is received.
https://github.com/nathan-osman/hang
assembly linux signal
Last synced: 1 day ago
JSON representation
Extremely simple Linux application that hangs until a signal is received.
- Host: GitHub
- URL: https://github.com/nathan-osman/hang
- Owner: nathan-osman
- License: mit
- Created: 2017-09-28T04:42:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-27T03:21:53.000Z (about 6 years ago)
- Last Synced: 2024-08-03T01:16:44.683Z (3 months ago)
- Topics: assembly, linux, signal
- Language: Assembly
- Size: 13.7 KB
- Stars: 152
- Watchers: 7
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## hang
This application does absolutely nothing. Once started, it will hang until a signal is received.
### Wait, what?
Despite its seemingly useless behavior, this application does serve an important purpose for me. I am using [caddy-docker](https://github.com/nathan-osman/caddy-docker) to monitor containers running in Docker. In order for caddy-docker to route requests to a container, it must remain running. Some containers don't actually do anything and exist solely to configure caddy-docker. However, they must remain running.
That's where this application comes in.
### Why assembly?
This application must not link against any libraries, ensuring it has no dependencies. That is easiest to do in assembly. The entirety of the application's functionality is to hang until a signal is received and this can be done easily with syscalls.
Also, where else can you find a Docker container that occupies less than 1 KB on disk?
### How do I use this?
Assuming you have GNU Make and Docker installed, simply run:
make
You will have a new binary named `hang` and it will be really small.