Hi There
I'm a Mac user who dabbles in a bit of the awesome ubuntu, I'm not a complete noob but I'm no expert! I've followed some really great steps on installing the airvideo server on my ubuntu 10.04 box at home. It all works nicely however I'm a little confused over the /opt folder - and not just for this application but in general when it comes to any application I would like to run from boot.
The issue I'm having is when I run a script from /etc/init.d it wont work on boot. If I move the application to my home folder e.g move /opt/airvideo-server to /home/media and change the script to reflect the path, then it works. Obviously there is a permissions issue.
If you want to know what steps I've taken so far (copied from the website instructions I'm following) see below:
Fire up a terminal and enter
sudo [text editor of choice] /etc/init.d/airvideo-server
In the file (which should be blank), paste the following:
#!/bin/bash
case "$1" in
start)
echo "Starting AirVideo"
start-stop-daemon --start --quiet -b -m -p /var/run/airvideo-server.pid --chuid airvideo --exec /usr/bin/java -- -jar /opt/airvideo-server/AirVideoServerLinux.jar /opt/airvideo-server/AirVideoServerLinux.properties
;;
stop)
echo "Stopping AirVideo"
start-stop-daemon --stop --quiet --pidfile /var/run/airvideo-server.pid
rm -f /var/run/airvideo-server
;;
*)
echo "Usage: /etc/init.d/airvideo-server {start|stop}"
exit 1
;;
esac
exit 0
Save the file out, then create the user which is going to be used to run the file. You should also double check to make sure that /opt/airvideo is readable by this account.
sudo adduser airvideo
Make the file executable, then add it to the startup defaults.
sudo chmod +x /etc/init.d/airvideo-server
sudo update-rc.d airvideo-server defaults
When you next reboot your system, airvideo should start automatically.
I've added the user 'airvideo' to my list of users as instructed, but what permissions need to be in place for:
1) the user?
2) /opt folder itself?
3) /opt/airvideo-server folder?
4) who needs to own the folder? or folders?
5) what else would be needed for the script to work?
This problem / solution would also help me with my teamspeak server setup which also only works outside of the /opt folder with a simple startup script.
I appreciate any input and help! Thanks!
Bookmarks