monexec icon indicating copy to clipboard operation
monexec copied to clipboard

"watch" function, to restart on file/folder changes

Open thim81 opened this issue 6 years ago • 3 comments

Hi Reddec,

It would be interesting to automatically restart a service application when a file is modified or if there are changes in a directory or its subdirectories:

Example file watch:

monexec ... --watch ./app.js

Example folder watch

monexec ... --watch ./code

and in the YAML file

services:  
- label: Netcat Sample Service  
 command: nc args: - -l - "9000" 
 stop_timeout: 5s 
 restart_delay: 5s 
 watch: ./app.js

Potentially in the future, there could be extensions, like "files to ignore"

Regards, Tim

thim81 avatar Jun 12 '19 11:06 thim81

Hi Thim!

No, there is no flag for that. Environment variables basically can not be changed after container launch without very specific instruments that more suitable for hackers than for normal usage patterns.

However, I can add a monitor that will watch changes for the .env files and for config files.

Can you specify priority? I am a bit busy now but if it's critical or high-priority I can implement quite fast

reddec avatar Jun 12 '19 13:06 reddec

Hi Reddec,

It is not urgent, so take your time. And perhaps I should rephrase the feature to indeed more of a file/folder watch logic.

Shall I modify the title and my orginal request, so that it is more related to this feature?

thim81 avatar Jun 13 '19 08:06 thim81

Hi Thim!

I will very appreciate it

reddec avatar Jun 13 '19 09:06 reddec