Learned this a few days ago…If your having troubles with your rc.local running through everything you’ve put in it, you might want to take out the top part saying:

#!/bin/sh -e

as the -e dictates that the shell exit on any of the commands return a nonzero status. Now, your commands really shouldn’t be doing this (hopefully) but if they are, taking out the “-e” can fix the problem and allow later commands to run without problems.

Source: Stackexchange

Mario Loria is a builder of diverse infrastructure with modern workloads on both bare-metal and cloud platforms. He's traversed roles in system administration, network engineering, and DevOps. You can learn more about him here.