File Overrides
From UntangleWiki
Contents |
About File Overrides
Overrides are meant to be used by the Untangle Developer Community. In a nutshell, the Untangle Server provides you, the developer, a means to create override rules to prevent the Untangle Server from changing specific system configuration files—files that you prefer to edit manually. We know how you like/need to edit configuration files, and we hope overrides make life easier for you.
Your Untangle Server environment consists of two distinct groups of files:
- Untangle system files. System files that are under the Untangle system's control. Most of these files are eligible for overrides.
- Rack software products files. Files that the Untangle system does not control. None of these files are eligible for overrides.
System Files
Untangle runs on a Linux operating system. When you do any of the following, the Untangle Server might make changes to the operating system's configuration files:
- Upgrade your Untangle Server.
- Interact with Untangle Server GUI.
Most of the time, such changes are intentional. For example, if you choose to assign the Untangle Server a new hostname, the Untangle Server does as you say and overwrites the /etc/hosts file. This scenario is probably not a case in which you want to create an override because it's much simpler to make such a change through the Untangle Server GUI. However, it's very likely that you might want to use a different hostname for your mailname.
When you change your Untangle Server's hostname using the Untangle Server GUI, Untangle writes the same hostname to both /etc/hostname and /etc/mailname. By default, when the Untangle Server emails recipients Untangle Reports, the fully qualified hostname that is listed in /etc/mailname appears in the email address. If you want the hostname for the email address to be different from the Untangle Server's hostname, you must specify the fully qualified hostname in the /etc/mailname file. However, in doing so, you must also create a override rule so that this file doesn't change the next time that you change your Untangle Server's hostname using the Untangle Server GUI.
Rack Software Product Files
Rack software product files cannot have override rules because the Untangle Server's system does not have control over these files. The software products are independent from the Untangle Server's system.
If you've been using OpenVPN for quite some time and prior to installing the Untangle Server, you might have configured your /etc/openvpn file from the command line. Perhaps you have a unique OpenVPN configuration. The important point is that your OpenVPN configuration meets your needs and works beautifully. The last thing you want is this file to change, right? If it ain't broke, don't fix it! Okay, "fare enough", but you can't use the Untangle Server's OpenVPN software product because once you do so that product controls the related configuration files. Instead, you must copy your /etc/openvpn/ file to another, standalone system, and host OpenVPN on that system.
Adding File Overrides
The Untangle Server provides a set of default file overrides (called system overrides), and they are turned off by dafault. If a file appears in the list of default overrides, you can be certain that it is eligible for an override rule. This default list consists of the most common overrides. However, you can also add a custom file override (called user overrides), but you must contact Untangle Technical Support before you do so because not all system files can have override rules.
An example of a file that is not eligible for an override rule is /etc/apt/source.lists. If you create an override rule for this file, the Untangle Server will not obey because it must have rights to this file in order for your system to function properly. If the Untangle Server is prevented from writing to this file, you will not be able to upgrade your Untangle Server.
By the way, the Untangle Server isn't immune to hardware failures, so it's still a good idea to back up your system.
To add a file override:
- Back up the configuration file that you want to protect.
- From the Navigation pane, choose Config > Networking.
- In the Advanced drop-down list, select Overrides.
- Do one of the following:
- If the file you want to protect is in the default list, uncheck its Writable check box.
- If the file you want to protect does not appear in the default list, click the Add button, type the file path in the new row, then uncheck its Writable check box.
- Enable the file override by selecting the On check box, then click Save.
- Test your file override by selecting an appropriate interface button that changes the configuration file that you want to protect.
- Go to the configuration file and verify that the file did not change. See, I told you it would work!
