diff --git a/README.md b/README.md index 82b61b1..f132274 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ Just copy the binary, and exec from the entry point script. There are three binaries in this project: `wingmate`, `wmpidproxy`, and `wmexec`. `wingmate` is the core binary. It reads config, starts, restarts services. It also -runs cron. Read [here](#wingmate-core-binary) for further details about `wingmate`. +runs cron. Read the [configuration](#configuration) section for files needed to run +`wingmate`. `wmpidproxy` is a helper binary for monitoring _legacy style_ service (fork, exit initial proces, and continue in background). Read [here](#wingmate-pid-proxy-binary) @@ -109,9 +110,30 @@ wmpidproxy --pid-file -- [:]] [--setsid] -- +``` +| Option | Parameter | Description | +|----------|-----------|----------------------------------------------------------------------------------------------------------| +| --user | uid[:gid] | Set the real user ID and the real group id. Uid and Gid can be either in numeric form or in name form | +| --setsid | | Set the process become the leader of its own process group, effectively detaching from parent's terminal | + +#### Example + +You can find example for `wmexec` in [here](docker/alpine/etc/wingmate) and [here](docker/bookworm/etc/wingmate) \ No newline at end of file diff --git a/docker/alpine/gettting-started.md b/docker/alpine/gettting-started.md deleted file mode 100644 index 0718b09..0000000 --- a/docker/alpine/gettting-started.md +++ /dev/null @@ -1,90 +0,0 @@ -# Getting Started - -_Note: This document is for Alpine base image user, if you are using Debian/Ubuntu read [this one](../bookworm/gettting-started.md) instead._ - -## Binaries - -There are three binaries in in this project: `wingmate`, `wmpidproxy`, and `wmexec`. - -`wingmate` is the core binary. It reads config, starts, restarts services. It also -runs cron. Read [here](#wingmate-core-binary) for further details about `wingmate`. - -`wmpidproxy` is a helper binary for monitoring _legacy style_ service (fork, exit -initial proces, and continue in background). Read [here](#wingmate-pid-proxy-binary) -for further details about `wmpidproxy`. - -`wmexec` is a helper binary for running process in different `user` or `group`. -It also useful for setting the process as process group leader. -Read [here](#wingmate-exec-binary) for further details about `wmexec`. - -## Building a container image based on wingmate image in Docker Hub - -Wingmate has no dependency other than `alpine` base image, so you just need to copy -the binaries directly. If you have built your application into an `alpine` based image, -all you need to do is copy whichever binary you need, crontab file (if you use cron) -and add some shell script to glue them together. Here is a Dockerfile example. - -```Dockerfile -# Dockerfile -FROM suyono/wingmate:alpine as source - -FROM alpine:latest -ADD --chmod=755 wingmate/ /etc/wingmate/ -ADD --chmod=755 entry.sh /usr/local/bin/entry.sh -COPY --from=source /usr/local/bin/wingmate /usr/local/bin/wingmate -COPY --from=source /usr/local/bin/wmpidproxy /usr/local/bin/wmpidproxy -COPY --from=source /usr/local/bin/wmexec /usr/local/bin/wmexec -ENTRYPOINT [ "/usr/local/bin/entry.sh" ] -CMD [ "/usr/local/bin/wingmate" ] -``` -You can find some examples for shell script in this [directory](../alpine/). - -## Configuration - -When `wingmate` binary starts, it will look for some files. By default, it will -try to read the content of `/etc/wingmate` directory. You can change the directory -where it reads by setting `WINGMATE_CONFIG_PATH` environment variable. The structure -inside the config path should look like this. - -```shell -/etc - └── wingmate - ├── crontab - ├── crontab.d - │   ├── cron1.sh - │   ├── cron2.sh - │   └── cron3.sh - └── service - ├── one.sh - └── spawner.sh -``` - -First, `wingmate` will try to read the content of `service` directory. The content of -this directory should be executables (either shell scripts or binaries). The wingmate -will run every executable in `service` directory without going into any subdirectory. - -Next, `wingmate` will read the `crontab` file. `wingmate` expects the `crontab` file using -common UNIX crontab file format. Something like this - -```shell - ┌───────────── minute (0–59) - │ ┌───────────── hour (0–23) - │ │ ┌───────────── day of the month (1–31) - │ │ │ ┌───────────── month (1–12) - │ │ │ │ ┌───────────── day of the week (0–6) (Sunday to Saturday) - │ │ │ │ │ - │ │ │ │ │ - │ │ │ │ │ - * * * * * -``` - -The command part only support simple command and arguments. Shell expression is not supported -yet. It is recommended to write a shell script and put the path to shell script in -the command part. - -# Appendix -## Wingmate core binary -### Service -### Cron -## Wingmate PID Proxy binary -## Wingmate Exec binary \ No newline at end of file diff --git a/docker/bookworm/gettting-started.md b/docker/bookworm/gettting-started.md deleted file mode 100644 index 21f6578..0000000 --- a/docker/bookworm/gettting-started.md +++ /dev/null @@ -1,12 +0,0 @@ -```shell -/etc - └── wingmate - ├── crontab - ├── crontab.d - │   ├── cron1.sh - │   ├── cron2.sh - │   └── cron3.sh - └── service - ├── one.sh - └── spawner.sh -``` \ No newline at end of file