I've tried using a /etc/init.d/ script, an upstart script, crontab, etc. None of the above are causing the script to execute on boot.
The service I am attempting to automatically start on boot is Upsource 2.0
The /etc/init.d/upsource script is executable, and I can run it using
service Upsource start
The contents of /etc/init.d/Upsource are as follows
#!/bin/sh
# /etc/init.d/Upsource
/opt/Upsource/bin/upsource.sh start
I have already run
update-rc.d Upsource defaults
The contents of /etc/init/upsource.conf are as follows
#Upsource
start on runlevel [2345]
stop on runlevel [016]
respawn
expect fork
chdir /opt/Upsource/bin
exec upsource start
The last lines of crontab -e is as follows
@reboot service Upsource start
@reboot echo "hello" > /root/downloads/test.txt
I can see /root/downloads/test.txt, and using cat on it results in "hello" being displayed, so I know it's running. When I issue reboot to the server the Upsource service is not automatically started, I have to issue the command manually for the service to start.
!
in your shebang line in the script? – Eric Renouf Feb 2 at 15:18/etc/rc.local
, that is started very late in the startup sequence – Anthon Feb 2 at 15:25