rc.local Ubuntu 18.04

Ubuntu 18.04 does not have a rc.local by default, but does use it if existant.

  • vi /etc/rc.local
    • #!/bin/sh -e
      #
      # rc.local
      #
      # This script is executed at the end of each multiuser runlevel.
      # Make sure that the script will "exit 0" on success or any other
      # value on error.
      
      # Custom commands
      uptime
      
      exit 0
  • chmod 700 /etc/rc.local