Auto Recreate Conf-Custom Files On ISPConfig Update: Monit Or Incron?

Discussion in 'Developers' Forum' started by ahrasis, Dec 31, 2020.

  1. ahrasis

    ahrasis Well-Known Member

    I writing yet another script for my servers that will create/recreate conf-custom folder files on ISPConfig install/update. I will share it later, once finished. I am in middle of choosing only one, either monit or incron, to monitor /usr/local/ispconfig/server/conf to execute the script in the event of any of the files in it changed. Thus I am wondering which is the best for efficiency and performance. The way I look at it now - incron is a default feature for linux while monit is something you will need to install, but my experience would want me to prefer monit over incron, therefore, I am seeking your opinions.
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Why do you need this? The conf-custom folder is untouched when updating.
     
  3. ahrasis

    ahrasis Well-Known Member

    Not all conf-custom should be left as they were, some need to be updated inline with the latest ISPConfig conf files.
     
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    You also have the conf-custom/install/ scripts, for which you can't use either to monitor for changes, since they are only in the installation source. Maybe add a function the installer to check for local hook scripts and call them if found? Pass to your hook script the stage of installation (so you could take different action at different points as needed, though you currently only need one) and the working directory of the installer, so your script can access the install templates.
     
  5. ahrasis

    ahrasis Well-Known Member

    I don't really need to auto create or recreate all of them but yes I do note some conf-custom/install files are from install/tpl like ispconfig.vhost.master.

    Well, the easiest now will be to have different folder for each version ISPConfig download and to compare the needed files, then create or recreate the customized version of that files.

    Thanks @Jesse Norell. I think that resolved my issues for the how to but still whether to use monit or incron is still in my mind.
     
  6. TonyG

    TonyG Active Member

    @Jesse Norell contributed to another thread on this topic, Triggers for server/conf(-custom) templates. I just found that, and it was very helpful. (Had to blow off a little steam there.) I've read many forum posts about conf-custom but didn't have a solid handle on it until now. That also means I now understand and appreciate what @ahrasis is doing.

    Perhaps one answer to this is to use VCS with hooks that notify us when a tpl or conf file changes, and where that file is also present in conf-custom. A full repo isn't necessary. Clone an empty repo, then create hard links to tpl, conf, and custom-conf. Those three folders become the new repo, and technically this one folder tree is the only one that needs to be monitored. Capture/hook git status run from nightly cron to notify of pending changes. Manually change and commit individual conf-custom files as you go through them.

    I use a process similar to that. I have a single repo folder with hardlinks to /etc /lib and a couple other folders, with .gitignore set for folders/files that aren't relevant. On update from v3.2.1 to v3.2.2 I immediately knew what had changed. I think a couple of you do something similar.

    HTH
     
  7. ahrasis

    ahrasis Well-Known Member

    Thanks for the reply and feedback @TonyG.

    It is a good idea but to cron the job to always monitor the source via git is not my preference as they may not be the final copy, as such, for now, as mentioned above, each new version of the downloaded and extracted ISPConfig source files, will be kept in a premanent folder for comparison purpose.

    The script will only execute the recreation of the needed conf-custom files if there are differences in between the latest two versions of ISPConfing needed conf files and other than the latest two versions of ISPConfig will be deleted.

    Still whether to use monit or incron is not resolved.
     
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I'd use incron, but I still don't see why you would use a conf-custom file if you let it update automatically :)
     
  9. ahrasis

    ahrasis Well-Known Member

    I do not except if there are changes in between versions which will be rare. Plus I don't see the developers are too concern about them either except in between big version upgrade, so I am less worry about the change but I want to ensure I keep my script in place, just in case, for peace of mind of course.
     

Share This Page