Put a script containing the command in your /etc directory. Create a script such as "startup.sh" using your favorite text editor.
vi mystartup.sh
# Mounting file system
sudo mkdir efs
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <efs_ip_here>:/ efs
# Asking it to wait for 30 seconds before starting the server
sleep 30
# Starting the tomcat server
sudo /home/ec2-user/efs/Tomcat/bin/startup.sh
Save the file in your /etc/init.d/ directory.
sudo mv mystartup.sh /etc/init.d/
Change the permissions of the script (to make it executable) by typing
"chmod +x /etc/init.d/mystartup.sh".
Deepesh Rajpal | c: 98282.38079 | rajpal.deepesh@gmail.com
Comments