I am using webrick server for my application in ~/sample. For every boot of computer, i need to start the webrick server in ~/sample. Kindly anyone help me to start up the webrick server at the initial boot of computer with specified port as automated startup.
If you're on a *nix platform, look at the startup scripts in /etc/init.d or
equivalent and make one for webrick. Recent Macs use `launchd`
with files named *.plist and again you can find plenty of examples to
use as a basis for your own script.
Hi Hassan
I am using linux only. I tried to create script on /etc/init.d. But, it doesnt start the webrick server within my project data @ ~/sample. If u know the script for initiating webrick from the /etc/init.d to my project data @ ~/sample during starting of OS kindly help me.
This script is working if i initiate as “/etc/init.d/webrick”. But, it doesnt start with system boot. (I provided 777 permission too…), I dont know this will be permission issue for execution or some other issue.
Your suggestion is valuable. I tried as you told...
<script>
#!/bin/bash
cd ~/sample
rails server &
</script>
This script is working if i initiate as "/etc/init.d/webrick". But, it
doesnt start with system boot. (I provided 777 permission too...), I
dont know this will be permission issue for execution or some other issue.
You need to place a symbolic link in the directory of your current runlevel. It's something like /etc/rcX.d/. You get your current runlevel by executing `runlevel`. On Debian based system it's supposed to be 2. So you have to place the link in /etc/rc2.d.
I included the /etc/init.d/webrick to System->Preferences->Startup Applications->Add “/etc/init.d/webrick”. Now its started and keep on running in my Linux. Thanks lot everyone for giving your suggestions. If you have any comment over this answer kindly post.
You are exactly correct, I accept. Up to my requirement, startup is enough to initiate webrick. Ofcourse, It needs to be do so, for boot time initiation.