I've tried run some scripts after boot via /etc/rc.local
.
/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.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/startup.sh
exit 0
/home/startup.sh
mount -t vboxsf test /home/test
Here is the result on boot
Here is the output of systemctl status rc-local.service
rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static)
Active: failed (Result: exit-code) since Sun 2016-02-07 22:48:23 ICT; 18min ago
Process: 432 ExecStart=/etc/rc.local start (code=exited, status=1/FAILURE)
Feb 07 22:48:23 debian rc.local[432]: /sbin/mount.vboxsf: mounting failed with the error: No such device
Feb 07 22:48:23 debian systemd[1]: rc-local.service: control process exited, code=exited status=1
Feb 07 22:48:23 debian systemd[1]: Failed to start /etc/rc.local Compatibility.
Feb 07 22:48:23 debian systemd[1]: Unit rc-local.service entered failed state.
I've tried manually running sudo bash /home/startup.sh and it works fine. I've also applied this method on Ubuntu 14.04
and no errors occurr.
What is the reason behind this failure? How can I fix it?
FAILED
? Namely, what doessystemctl status rc-local.service
report when run as root?