This is quite a simple one. I created an rc.local file here:
/etc/rc.local
I made it executable. However, it doesn't run when I boot the server. I can see it in the directory and when I try to run it manually I get this message:
root@:/etc# rc.local
rc.local: command not found
My rc.local file reads as follows:
#!/bin/sh -e
# FUNCTIONS
function setup_logs
{
exec > >(tee -a /var/log/deploy.log)
exec 2> >(tee -a /var/log/error.log)
}
# COMMANDS
setup_logs
apt-get update # Update aptitude list
apt-get -y dist-upgrade # Upgrade aptitude programs
cd /etc/spider && git pull # Update deployment code
cd /etc/code && git pull # Update library code
cd /etc/code && deployment.sh # Run deployment script
exit 0
For the life of me I don't understand where I am going wrong, can anyone give me some help?