Skip to content
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

A probably simple feature request: Simple support for post processing #1039

Closed
schittli opened this issue May 24, 2024 · 3 comments
Closed

Comments

@schittli
Copy link

schittli commented May 24, 2024

Hello
thanks a lot for sharing your great and very useful work - for more than 1/4 century! 😃

I think I have a simple little improvement suggestion that could serve many users / open up new user groups:

Initial situation

  • I love unison to sync configuration files between redundant computers because it is pretty simple to set up.
  • But: Some services like the nginx community edition need to be informed if the configuration files have been changed (here by unsion synchronization).

It would therefore be very useful:

  1. If the unison exit code would additionally return a new code for: "All files were already up to date. (Unison has not changed any file)". This would make it very easy for the Unison caller to perform post-sync actions.
    Important: The exit code must say if the files on the local server, on the remote server or on both servers have been changed.
  2. Or: It would be brilliant if we could configure something like: PostProcessorOnFileChanged: <path to command / script>: This command / script would be executed as soon as the synchronization has changed at least one file. Important: Unison must pass a parameter which tells if files on the local server, on the remote server or on both servers have been changed.

Thanks a lot, kind regards,
Thomas

@celane
Copy link

celane commented May 24, 2024 via email

@schittli
Copy link
Author

Hello @celane,

Thank you very much for your reference to syntool!

  • Syntool is a interesting product for a data center / many servers, but we have just 2 Servers and want to modify the original configuration files, test the changes and then synchronize them automatically to the other computer.
  • With syntool, however, one synchronizes configuration files from a central directory to the computers with the services.
  • This means that one has to set up infrastructure / workflows in order to test configuration changes, and move them to the syntool deployment directory.

That's why unison is a much simpler and more elegant solution:

  1. one logs on to any computer where a configuration needs to be changed
  2. one makes the change and test it
  3. Unison will do the reast

This workflow is really great, because a system engineer can work as usual. The only thing is that if a file had to be synchronized, Unison does not report this event via exit code and does not offer to execute a command for this event.

I therefore very much hope that it will be very easy for Unison to return an additional exit code or read the config file and execute a command.

But synchronizing config files, that need some post-update processing (…) is more of a "1:N" task (one main host configuring many others).

I've been in IT for 30 years in companies with 12 to 750 employees and have never once had the situation you describe. So I'm pretty sure that a lot of people can benefit from a Unison that somehow signals that files have been modified 😀. The background to this is that we could only ever do load balancing and failover with 2 servers at a time - that was always completely sufficient.

Thanks a lot, kind regards,
Thomas

@gdt
Copy link
Collaborator

gdt commented Jun 9, 2024

The issue tracker is only for fully-baked feature requests. Since we're already having an argument about how best to re-implement Ansible with unison, this isn't one of those :-) I am curious whether you did not see https://github.com/bcpierce00/unison/wiki/Reporting-Bugs-and-Feature-Requests or whether you did and thought this belonged here vs the list?

I have moved this issue to

https://github.com/bcpierce00/unison/wiki/Feature-Requests

Please feel free to bring this up one one of the mailinglists. (Also, if you aren't proposing to develop the feature yourself, it's pretty unlikely anything would happen.)

@gdt gdt closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants