I'm creating a server on my RPi that's on a timer, so I want to have a command run at startup to begin the server processes. I've seen this: Execute script on start-up, but it doesn't explain it well enough, since I don't really know what kind of script it is. (P.S. I'm talking about the middle method's tutorial, just to clarify.) All I want to do is to run $ sudo /opt/jdk1.8.0/bin/java -Xms256M -Xmx496M -jar /home/pi/spigot.jar nogui
(Tutorial Link) so it begins my server without me typing it in every day when I have better things to do than to SSH into my RPi so my friends can play Minecraft.
What script would I need to write? I understand everything else in the tutorial, but I don't understand how to write the code since I don't know what language it is. I am a fairly experienced coder, but the RPi is all that I have had to do with Linux, besides the occasional Ubuntu Wubi.
I will accept either code excerpts or a simple tutorial on actually writing the script. Post comments for any questions you have. I'm using a updated version of Debian, but without LXDE enabled on boot and 16 MB GPU RAM (headless server connected via SSH).
$ sudo nano etc/rc.local
and place the command withoutsudo
on a new line and then save it, reboot, and watch the magic happen? – Anonymous Penguin Sep 24 '13 at 00:52sudo nano /etc/rc.local
You really should read some basic texts on linux. I probably should have said/etc/rc.local
but most would understand the filesystem, and immediately have realised the cause of the error. Incidentally, this is not the best way to modify system files. You really should only edit on a copy, and backup the original. This isn't really the best place for an introductory tutorial. – Milliways Sep 25 '13 at 04:34