M
M
Miku Hatsune2016-03-11 22:51:35
linux
Miku Hatsune, 2016-03-11 22:51:35

Why doesn't autorun SH script work in ubuntu?

There is a script, for example it lies in "/home/user_name/service/start.sh"
If I say from user_name in the console:
[email protected]~/service: ./start.sh start
It starts, everything works, but I need it to start itself when the machine reboots.
I write in user_name'a's crontab:
@reboot /home/user_name/service/start.sh start
I will reboot the machine - nifiga.
But the autostart of the TS3 server is registered above and it starts ...:

@reboot /home/user_name/teamspeak3-server_linux_amd64/ts3server_startscript.sh start

Why is that? How to autostart the desired service?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad Zhivotnev, 2016-03-11
@Hatsune-Miku

Inside the script, write the full paths to the binaries.

F
Fixid, 2016-03-11
@Fixid

@reboot bash /home/user_name/service/start.sh start
worked for me
run /home/user_name/service/start.sh start from any other folder

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question