> Source: [sk181317](https://support.checkpoint.com/results/sk/sk181317)

# sk181317 - "unable to watch directory /etc/routed-mc-enable: init: Too many open files" error in clish when configuring dynamic routing

| Property | Value |
|----------|-------|
| Solution ID | sk181317 |
| Date Created | 2023-10-22 |
| Last Modified | 2026-07-23 |
| Technical Level | General |
| Products | Security Gateway, Scalable Platforms |
| Versions | R82.10, R82, R81.20, R81.10 (EOS), R81 (EOS), R82.10, R82, R81.20, R81.10 (EOS) |
| OS | Gaia |

## Symptoms

- * "`RTGRTG0019 mc_enabling_check_startup(76): unable to watch directory /etc/routed-mc-enable: init: Too many open files`" error in Clish when configuring dynamic routing.

* Rebooting the Security Gateway resolves the issue only temporarily.

* When adding or deleting static routes in the huge VSX environment (more than 50 VS and hundreds of the static routes)

## Cause

When the Gaia OS saves the configuration, the OS checks for the file named */etc/routed-mc-enable/instance-\<instance\>* to determine whether multicast routing is enabled or not.

The error "*Too many open files*" in this case means that the routed process has exceeded the process' limit of open file descriptors.

## Solution

This problem was fixed. The fix is included in:

* [Jumbo Hotfix Accumulator for R82.10](https://sc1.checkpoint.com/documents/Jumbo_HFA/R82.10/Default.htm) starting from Take 19
* [Jumbo Hotfix Accumulator for R82](https://sc1.checkpoint.com/documents/Jumbo_HFA/R82/Default.htm) starting from Take 103
* [Jumbo Hotfix Accumulator for R81.20](https://sc1.checkpoint.com/documents/Jumbo_HFA/R81.20/Default.htm) starting from Take 158

If you choose not to upgrade, follow these instructions:

1. Connect to the command line of the Security Gateway.

   In a clustered environment, connect to each cluster member.
2. Log in to Expert mode.

3. Double the current value of the "**optmem_max**" parameter:

   `[Expert@GwHostname:0]# echo -ne Old optmem_max value: "$(cat /proc/sys/net/core/optmem_max)\n""New optmem_max value: " $(bc -l <<< $(cat /proc/sys/net/core/optmem_max)*2)"\n" ; echo $(bc -l <<< $(cat /proc/sys/net/core/optmem_max)*2) > /proc/sys/net/core/optmem_max`
4. Double the current value of the "**igmp_max_memberships**" parameter:

   `[Expert@GwHostname:0]# echo -ne Old igmp_max_memberships value: "$(cat /proc/sys/net/ipv4/igmp_max_memberships)\n""New igmp_max_memberships value: " $(bc -l <<< $(cat /proc/sys/net/ipv4/igmp_max_memberships)*2)"\n" ; echo $(bc -l <<< $(cat /proc/sys/net/ipv4/igmp_max_memberships)*2) > /proc/sys/net/ipv4/igmp_max_memberships`
5. If the new values did not resolve the issue, double them **one more time**.

   Do **not** increase these values more than two times.
   If increasing the values for "igmp_max_memberships" and "optmem_max" resolved the issue continue to step 7.
6. [Contact Check Point Support](https://www.checkpoint.com/support-services/contact-support/) to investigate this issue if increasing the value twice did not help.

7. If the new values resolved the issue, add the applicable commands to the "*/etc/rc.d/rc.local* " start-up shell script (Gaia OS overrides the user-defined settings in the */etc/sysctl.conf* file:)

   1. Back up the current script:

      `[Expert@GwHostname:0]# cp -v /etc/rc.d/rc.local{,_BKP}`
   2. Update the script:

      1. `[Expert@GwHostname:0]# echo "#Manual configuration based on sk181317" >> /etc/rc.d/rc.local`

      2. `[Expert@GwHostname:0]# echo "echo $(cat /proc/sys/net/core/optmem_max) > /proc/sys/net/core/optmem_max" >> /etc/rc.d/rc.local`

      3. `[Expert@GwHostname:0]# echo "echo $(cat /proc/sys/net/ipv4/igmp_max_memberships) > /proc/sys/net/ipv4/igmp_max_memberships" >> /etc/rc.d/rc.local`

8. To fix the Routed issue during the "VSX Push configuration" operation:

   1. Make the change only in the current session (does not survive reboot). Run in the context of VS0:

      `[Expert@GwHostname:0]# echo -ne Old max_user_instances value: "$(cat /proc/sys/fs/inotify/max_user_instances)\n""New max_user_instances value: " $(bc -l <<< $(cat /proc/sys/fs/inotify/max_user_instances)*4)"\n" ; echo $(bc -l <<< $(cat /proc/sys/fs/inotify/max_user_instances)*4) > /proc/sys/fs/inotify/max_user_instances`

      Example output:

      ```
      Old max_user_instances value: 128
      New max_user_instances value: 512
      ```

      To verify, run:

      `[Expert@GwHostname:0]# cat /proc/sys/fs/inotify/max_user_instances`
   2. Make the change permanent (to survive reboot):

      Add the applicable commands to the "*/etc/rc.d/rc.local* " start-up shell script (Gaia OS overrides the user-defined settings in the */etc/sysctl.conf* file:)
      1. `[Expert@GwHostname:0]# echo "#Manual configuration based on sk181317" >> /etc/rc.d/rc.local`

      2. `[Expert@GwHostname:0]# echo "echo $(cat /proc/sys/fs/inotify/max_user_instances) > /proc/sys/fs/inotify/max_user_instances" >> /etc/rc.d/rc.local`

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
