Nginx – Why are nginx configuration files read-only on FreeBSD

file-permissionsfreebsdnginx

After installing Nginx on FreeBSD 8.3 from ports, the configuration files in /usr/local/etc/nginx all have read-only permissions. Is there a reason for this? Am I not supposed to edit them? Or can I safely ignore that fact and modify them anyway?

Best Answer

I don't use nginx (and therefore don't use the port), but looking at the port it does the "standard" thing of copying the dist files over as the "live" files for a fresh install.
The maintainer specified the -p flag in doing this, which preserves the file mode, so the resulting "live" files are read-only.

There is no reason you can't make these files writeable by a specific user/group, or just edit them as root and ignore the lack of write permissions.


If you think this behavior is undesirable you should file a PR - it would be a pretty easy thing for the port maintainer to change.
Chances of getting it changed go up dramatically if you provide a patch (the offending file in the port is pkg-plist, and more information on how that file works can be found in The Porter's Handbook.)