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

## Product
Maestro HyperScale Firewall, Security Gateways, VSX (Traditional)

## Version
R80.40 (EOS), R81 (EOS), R81.10 (EOS), R81.20, R82, R82.10

## OS
Gaia

## Last Modified
2026-07-23

## 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
         ```

#### NOTE
This solution has been verified for the specific scenario, described by the combination of Product, Version and Symptoms. It may not work in other scenarios.

## Article Properties
- **Access Level**: General
- **Status**: Approved by TAC
- **Date Created**: 2023-10-22
- **Last Modified**: 2026-07-23
