I have Ubuntu 16.04. I am trying to run commands in
/etc/rc.local, but they are not running correctly. I have enabled
sudo systemctl enable rc-local.service. I can see
rc.local has run and the exit value using
sudo systemctl status rc-local.service. I can change the exit value and can see the change in the systemctl status, so I know
rc.local is running. Here are the commands.
sudo echo updatetime >> /home/admin/log.txt sudo /home/admin/updatetime.sh sudo date >> /home/admin/log.txt
Nothing is added to my log file. My time is not updated. I can run the script from terminal using
sudo /home/admin/updatetime.sh and the time will update. I have checked all the file permissions and everything is readable, executable and writable. Please help. I'm at a complete loss for why I can't get this to work.