rc-local.service¶
On ubuntu, I noticed that this service is failed. Refer the following links to understand the issue and resolve.
Reference 1 | Reference 2 | Reference 3 |
Following is my understanding:
- rc means Run Control.
- The file
rc.localdoes not contain information on system startup components, but only superuser/root defined components. - Not all root startup programs are described in rc.local but only those which don’t interfere with system components
- the file rc.local is executed after normal services are started.
- The failure mostly related to not ending the script with
exit 0or your default script is not /bin/sh. Adding#!/bin/sh -eat the begining of the script andexit 0at the end of the script. sometime the script is not executable and not owned by root. - We may add service to enable it via servicectl.
- you can create the file, if it doesnt' exists (as given in Reference 3).
- This is one of the mechanism available. crontab can also be used for the same purpose
My view: I prefer to use this to run start up scripts for the applications I host in the server. But for the services, setting up via systemctr seems more convenient to maintain.