Birger_Skogeng_Ped
November 1st, 2014, 12:08 PM
Hi all,
I'm fairly new to Linux (as I'm sure you're all about to realize). I've been searching for weeks to figure this out, but I just can't wrap my head around it.
I have a server running ubuntu server (no desktop, using PuTTY to administrate it from my Windows home computer). On this server I have 3-4 applications that I need to startup automatically whenever the server is rebooted. I cannot figure out what is the cleanest, most proper way to do this. I need my server to set the environment variables first, then run several different scripts/commands.
Until now I have tried adding two scripts:
/etc/profile.d/startup.sh
#!/bin/sh
export JAVA_HOME=/opt/java/jdk1.8_0_25
export PATH=$PATH:$JAVA_HOME/bin
sudo -u myuser /home/myuser/startup.sh
/home/myuser/startup.sh
sh ~/Applications/apache/bin/startup.sh
sh ~/Applications/teamspeak/ts3server_start.sh
But my server applications wont start until i log into the server. Also the apache application states that there is no JAVA_HOME set. But after I have logged in, JAVA_HOME IS set and I can run the server application...
Please help me understand what the proper way for setting my server is.
Sincerely,
Birger
I'm fairly new to Linux (as I'm sure you're all about to realize). I've been searching for weeks to figure this out, but I just can't wrap my head around it.
I have a server running ubuntu server (no desktop, using PuTTY to administrate it from my Windows home computer). On this server I have 3-4 applications that I need to startup automatically whenever the server is rebooted. I cannot figure out what is the cleanest, most proper way to do this. I need my server to set the environment variables first, then run several different scripts/commands.
Until now I have tried adding two scripts:
/etc/profile.d/startup.sh
#!/bin/sh
export JAVA_HOME=/opt/java/jdk1.8_0_25
export PATH=$PATH:$JAVA_HOME/bin
sudo -u myuser /home/myuser/startup.sh
/home/myuser/startup.sh
sh ~/Applications/apache/bin/startup.sh
sh ~/Applications/teamspeak/ts3server_start.sh
But my server applications wont start until i log into the server. Also the apache application states that there is no JAVA_HOME set. But after I have logged in, JAVA_HOME IS set and I can run the server application...
Please help me understand what the proper way for setting my server is.
Sincerely,
Birger