-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to exec processes in background mode #22
Comments
Isn't the check and reload commands what you need? |
Hi, unfortunately no. :(
As I understand reload_cmd command can not be used as start_cmd.
I want to do something like that:
exec: systemctl start $name
...
reload_cmd: systemctl reload $name
This will be prevent program $name to die if remco will have been restarted
and allow to start $name just after recmo have finished his work not before.
|
I've added a start_cmd option. The config looks like: [[template]]
src = "/etc/remco/templates/test.cfg"
dst = "/home/rkaufmann/Downloads/remcotest"
mode = "0644"
start_cmd = "echo 'start'"
reload_cmd = "echo 'reload'" Could you try this with latest master to see if that works for you? |
Oh, it's great!
I'll try as soon as I see my laptop. =)
On Sun, Aug 12, 2018, 7:15 PM Rene Kaufmann ***@***.***> wrote:
I've added a start_cmd option.
The start command is executed only once at startup. If no start command is
specified, the behavior is the same as before.
The config looks like:
[[template]]
src = "/etc/remco/templates/test.cfg"
dst = "/home/rkaufmann/Downloads/remcotest"
mode = "0644"
start_cmd = "echo 'start'"
reload_cmd = "echo 'reload'"
Could you try this with latest master to see if that works for you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIAVS8waIhUWbI74LazXZPYqYxToNyOTks5uQFS2gaJpZM4V5RDf>
.
--
Best regards, Artyom
|
If start_cmd is a part of template it is not possible to define several
templates for single app.
It's a reason why I thought to define it in exec array.
If templates is single resource generates in defined order?
On Sun, Aug 12, 2018, 7:15 PM Rene Kaufmann ***@***.***> wrote:
I've added a start_cmd option.
The start command is executed only once at startup. If no start command is
specified, the behavior is the same as before.
The config looks like:
[[template]]
src = "/etc/remco/templates/test.cfg"
dst = "/home/rkaufmann/Downloads/remcotest"
mode = "0644"
start_cmd = "echo 'start'"
reload_cmd = "echo 'reload'"
Could you try this with latest master to see if that works for you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIAVS8waIhUWbI74LazXZPYqYxToNyOTks5uQFS2gaJpZM4V5RDf>
.
--
Best regards, Artyom
|
Youre right. name = "someName"
start_cmd = "echo 'start'"
[[template]]
src = "/etc/remco/templates/test.cfg"
dst = "/home/rkaufmann/Downloads/remcotest"
mode = "0644"
reload_cmd = "echo 'reload'" |
Maybe a reload_command at the resource level would also make sense. What do you think? |
I've tested
resource.d/nginx.toml
Great idea! I think there are cases when one template required a reload and other one does not, so it's better to make This allow to define |
Hm, the start_cmd is only executed after all templates are processed without errors. I will change the code so that the reload_cmd is not called if a start_cmd is provided (only at startup obviously).
I plan to keep both reload commands: one per template for fine grained control and one on the resource level. Both are optional. Thank you for your help! |
Even if template's render have finished successful |
Are you sure that you're using the latest master branch? cat /etc/remco/resource.d/test.toml
|
Yes, just have recompiled. =(
Latest commit - 9eda77c |
What is the exact content of /etc/remco/resource.d/nginx.toml? |
I simplify it as I can. Here is tar with compiled Something is wrong here =( |
Your file doesn't work for me either. Thats always the path the buildscript uses.
|
All import paths are like this: github.com/HeavyHorst/remco/pkg/template |
I've also added the mentionend reload command.
Also done. let me know if you have any more problems building the source. |
Oh, sorry, my mistake. I've tested Thank you very much! |
Great! I will leave this issue open until i've added the documentation. |
@HeavyHorst DOCU PLS?! |
Hi,
I'm looking on
remco
as a configuration manage tool inside containers for our cloud infrastructure.We are using system OS containers with several applications inside and
systemd
is used as an init system.remco
is starting as a daemon before any services for which configs should be generated.But here is a problem - there is not option to detect if remco's resources have been successfully proceed and services could be start.
To resolve this there is exec option (command) but it require foreground mode which is not suitable for systemd services. =(
Also I do not like an idea to run services in foreground mode because they will be killed if
remco
failed and died. It's ok ifremco
is used as a supervisor or init system (proc 1) but decrease reliability if it works as configuration management tool only.I suggest to add additional option and allow to exec processes in background mode.
The text was updated successfully, but these errors were encountered: