I wish to execute a script every time on boot-up using /etc/rc.local.
My script for example is called startscript.sh which is stored in /home/debian as below. It first tries to create a file called test.log and then does other things.
However, I read the error on boot-up that touch: cannot touch ‘test.log’: Permission denied
How is this even possible if, from what I understand, rc.local gets run as root, therefore anything it executes should be run as root as well, and hence test.log should be created regardless?
startscript.sh:
#!/bin/sh
touch test.log
#... other stuff
rc.local snippet:
#!/bin/sh -e
#.. other stuff
sh /home/debian/startscript.sh