MinimServer Forum

Full Version: Minimserver Autostart Ubuntu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Simon, great info. I tried it, but it doesn't work for me. Followd the linked page and copied your file (with a change to the directory). Is there anything else you've done? Thanks.

At the moment I have the Autostart.sh in the home directory and need to use it every time the RBPI get's restarted.

Any help/advise appreciated!
(28-11-2013 16:41)ReneZ Wrote: [ -> ]Simon, great info. I tried it, but it doesn't work for me. Followd the linked page and copied your file (with a change to the directory). Is there anything else you've done? Thanks.

At the moment I have the Autostart.sh in the home directory and need to use it every time the RBPI get's restarted.

Any help/advise appreciated!

You need to put the file that I posted in the right place and also use the update-rc.d command to create the links that will run it. This should work if you are using Debian or Raspbian.

If you are using Ubuntu, there is a simpler way to do this. You can create an entry in "startup applications" that runs the autostart.sh file.
Simon, thanks. I'm using Raspbian.

I have put the file in /etc/init.d/, changed the authorisation and did the update command. I'll try gain :-)

Cheers, Rene
(28-11-2013 17:15)ReneZ Wrote: [ -> ]Simon, thanks. I'm using Raspbian.

I have put the file in /etc/init.d/, changed the authorisation and did the update command. I'll try gain :-)

Cheers, Rene

On my RPi, I have saved the script that I put in my post under the name 'minimserver' in the /etc/init/d directory and set the attributes to 755. Note that this script is not the same as the autostart.sh script.

After you have run the update command, there should be links to this script in the directories /etc/rc2.d, /etc/rc3.d, /etc/rc4.d and /etc/rc5.d. All these links should all be named S01minimserver.
Simon, I tried it again, but this is what I get:

pi@raspberrypi /etc/init.d $ sudo /etc/init.d/minimserver.sh start
sudo: unable to execute /etc/init.d/minimserver.sh: No such file or directory

This although the file minimserver.sh exists in the /etc/init.d subdirectory. This makes me think the directory inside the .sh file can't be called.

Minimserver recides in /home/pi/minimserver-0.72/

Trying to tart locally I get this:

pi@raspberrypi ~/minimserver-0.72 $ sudo autostart.sh start
sudo: autostart.sh: command not found

Any further tips? I have also included the link as per page1 in the rc.local file, but that doesn't work as well.

Thanks, Rene
(28-11-2013 18:52)ReneZ Wrote: [ -> ]Simon, I tried it again, but this is what I get:

pi@raspberrypi /etc/init.d $ sudo /etc/init.d/minimserver.sh start
sudo: unable to execute /etc/init.d/minimserver.sh: No such file or directory

This although the file minimserver.sh exists in the /etc/init.d subdirectory. This makes me think the directory inside the .sh file can't be called.

Minimserver recides in /home/pi/minimserver-0.72/

Trying to tart locally I get this:

pi@raspberrypi ~/minimserver-0.72 $ sudo autostart.sh start
sudo: autostart.sh: command not found

Any further tips? I have also included the link as per page1 in the rc.local file, but that doesn't work as well.

Thanks, Rene

I have named the init.d file 'minimserver', not 'minimserver.sh'. What did you name it? If you have named it 'minimserver' as well, you would need to run the command:

sudo /etc/init.d/minimserver start

Please also check that the 'minimserver' file has permissions 755.

You are using the wrong command to run the autostart.sh script. To run this script, type the command:

/home/pi/minimserver-0.72/autostart.sh

You should not be runnning this script using sudo, and it doesn't need a 'start' parameter.
Thanks Simon.

tried as follows:

pi@raspberrypi ~/minimserver-0.72 $ /home/pi/minimserver-0.72/autostart.sh
pi@raspberrypi ~/minimserver-0.72 $ /home/pi/minimserver-0.72/autostart.sh: 5: /home/pi/minimserver-0.72/autostart.sh: cannot create minimserver.out: Permission denied
/home/pi/minimserver-0.72/autostart.sh: 5: /home/pi/minimserver-0.72/autostart.sh: java: not found

Obviously a bit more is not right I guess.

It works OK if I run the following from the home directory (command ./minimserver.sh)

The file content is:

cd /home/pi/Java/jdk1.7.0_40/bin
./java -jar //home/pi/minimserver-0.72/lib/minimserver.jar --quiet --nohup &

This will start the server properly.

I'll start diggin and reading a bit more. Shouldn't be too difficult to get it to 'auto start' :-)

R
(28-11-2013 19:17)ReneZ Wrote: [ -> ]Thanks Simon.

tried as follows:

pi@raspberrypi ~/minimserver-0.72 $ /home/pi/minimserver-0.72/autostart.sh
pi@raspberrypi ~/minimserver-0.72 $ /home/pi/minimserver-0.72/autostart.sh: 5: /home/pi/minimserver-0.72/autostart.sh: cannot create minimserver.out: Permission denied

This probably means there is a minimserver.out file owned by root because of your previous incorrect use of sudo to run this command.

Quote:/home/pi/minimserver-0.72/autostart.sh: 5: /home/pi/minimserver-0.72/autostart.sh: java: not found

This probably means Java is not installed correctly. You should use the command:

sudo apt-get install oracle-java7-jdk

to install Java in the correct location.
Simon, as per below.

pi@raspberrypi ~ $ sudo apt-get install oracle-java7-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package oracle-java7-jdk

What is the correct location for Java?
Simon, possible superfluous, but I'm using the 'hard float' version.

Must dmit I'm thinking of starting fresh altogether. Problem is that all was installed as advised per install pages, so am a bit at a loss.

Had a look at http://www.stuffaboutcode.com/2012/06/ra...rt-up.html but that file is quite different than yours.

I'm probably proof that a tiny bit of knowledge is rather dangerous :-)

Thanks!
Pages: 1 2 3
Reference URL's