sven-lange-last commented on issue #3007: Clean orphaned ifstate.veth* files on Ubuntu 14.04 URL: https://github.com/apache/incubator-openwhisk/pull/3007#issuecomment-347142421 ### Cleaning script design #### Build regular expression that matches all active virtual ethernet interfaces 1. Use following command to determine all active veth interfaces: `ip -oneline link show`. 2. Extract all interface names `veth<X1>` to `veth<Xn>`. 3. Build a regular expression that matches their corresponding files in `/run/network`: `/run/network/ifstate\.(veth<X1>|<...>|veth<Xn>)`. #### Remove orphaned files older than 60 minutes 1. Use `find` command: https://www.gnu.org/software/findutils/manual/html_mono/find.html. 2. Find all files in `/run/network/` that match `ifstate.veth*` but do NOT match the regular expression prepared above - i.e. only inactive files. 3. On active systems, there may be race conditions where new `veth` interfaces are added while the `find` command is running but after the active virtual ethernet interfaces have been identified. These new interfaces are active and need to be preserved. 4. To be on the safe side, only orphaned files older than 60 minutes should be cleaned. 5. Use filter `-mmin +60` which only matches files older than 60 minutes (see https://www.gnu.org/software/findutils/manual/html_mono/find.html#Age-Ranges).
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
