krallin / tini

A tiny but valid `init` for containers
MIT License
9.66k stars 505 forks source link

Event not generated when File change happens #201

Open vishnuramvs29 opened 1 year ago

vishnuramvs29 commented 1 year ago

I am using tini to monitor for file changes tini -vvv -S 1 -F config/data/infra_postgres.json --- ./app

I can see tini logs for my apps and also see file also been detected by tini.

[DEBUG tini (1)] Found a new file: /config/data/infra_postgres.json, dev: 0, ino: 0 mtime: 0, ctime: 0
[INFO  tini (1)] Spawned child process './app' with pid '8'
[TRACE tini (1)] No child to reap

But when I change the content of the file "infra_postgres.json", I am not getting any logs from tini saying "File change detected" or signal SIGHUP(1) is also not sent.

Can someone help with this?

yosifkit commented 1 year ago

:confused: tini doesn't have a -F option:

$ tini -vvv -F ./package.json rails server -b '0.0.0.0'
tini: invalid option -- 'F'
tini (tini version 0.19.0)
Usage: tini [OPTIONS] PROGRAM -- [ARGS] | --version

Execute a program under the supervision of a valid init process (tini)

Command line options:

  --version: Show version and exit.
  -h: Show this help message and exit.
  -s: Register as a process subreaper (requires Linux >= 3.4).
  -p SIGNAL: Trigger SIGNAL when parent dies, e.g. "-p SIGKILL".
  -v: Generate more verbose output. Repeat up to 3 times.
  -w: Print a warning when processes are getting reaped.
  -g: Send signals to the child's process group.
  -e EXIT_CODE: Remap EXIT_CODE (from 0 to 255) to 0.
  -l: Show license and exit.

Environment variables:

  TINI_SUBREAPER: Register as a process subreaper (requires Linux >= 3.4).
  TINI_VERBOSITY: Set the verbosity level (default: 1).
  TINI_KILL_PROCESS_GROUP: Send signals to the child's process group.

https://github.com/krallin/tini/blob/378bbbc8909a960e89de220b1a4e50781233a740/src/tini.c#L226-L264