Ownership change after file updates

Discussion in 'Installation/Configuration' started by Hannah Novick, Feb 24, 2021.

  1. Hannah Novick

    Hannah Novick New Member

    To execute jobs on Linux server, config files should be owned by a certain account. However, these files will be updated per use case, prior to running a job. Group, others have recursive RWX permissions on the folder. When an user from the group makes any updates to the config files, the owner would be changed to that user. This causes the job to fail with permission denied error. How can we fix this that the permissions are not changed?
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    This behavior is entirely dependent upon the program making changes to the file, eg. a normal text editor like vi would not do this. Likely the program is removing or renaming the file and creating a new one to replace it.
    Change the behavior of the software which writes the file. Or do something to fix the permission afterwards (eg. write a script utilizing inotifywait to reset it, or use incron to watch/reset it, or setup monit to do so).
  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You wrote that permissions are not changed, the owner is changed.
    What @Jesse Norell wrote is correct. But depending on circumstances you may get away with setting up a "Project directory and group".
    Something like this, use Internet Search Engines to find more info
    • make the directory group owned by projectgroup
    • chmod g+s that directory
    • add all users writing to that directory to projectgroup
    • set umask for those users to allow rw and possibly x for created files, at least when writing to that project directory.

Share This Page