Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minimserver Autostart Ubuntu
12-02-2013, 11:30
Post: #1
Minimserver Autostart Ubuntu
I am experimenting with Ubuntu what would be nice is if Minimserver would startup automatically after booting the system. I tried the following, see screenshot.

   

As I said I am a starting user of Ubuntu. what is wrong? If I use the command in the terminal it starts up correctly, not through the 'Startup Applications'.
Find all posts by this user
Quote this message in a reply
12-02-2013, 13:16
Post: #2
RE: Minimserver Autostart Ubuntu
(12-02-2013 11:30)jvilly Wrote:  I am experimenting with Ubuntu what would be nice is if Minimserver would startup automatically after booting the system. I tried the following, see screenshot.

As I said I am a starting user of Ubuntu. what is wrong? If I use the command in the terminal it starts up correctly, not through the 'Startup Applications'.

Please do the following:

1) Create a file named autostart.sh in the ~/minimserver-0.63 directory containing the following lines:
Code:
#!/bin/sh

cd "$( dirname "$0" )"/data
java -jar ../lib/minimserver.jar --noconsole --nohup </dev/null >minimserver.out 2>&1 &

exit 0

2) Use the chmod 755 command to make the autostart.sh file executable.

3) In the Edit Startup Program dialog, change the command to:
Code:
/home/<username>/minimserver-0.63/autostart.sh
where <username> is your user name. You can't use '~' for this here.

I've tried this on Ubuntu, and it's working for me.

I'll add this autostart.sh script to the next release of MinimServer.
Find all posts by this user
Quote this message in a reply
12-02-2013, 13:44
Post: #3
RE: Minimserver Autostart Ubuntu
(12-02-2013 13:16)simoncn Wrote:  
(12-02-2013 11:30)jvilly Wrote:  I am experimenting with Ubuntu what would be nice is if Minimserver would startup automatically after booting the system. I tried the following, see screenshot.

As I said I am a starting user of Ubuntu. what is wrong? If I use the command in the terminal it starts up correctly, not through the 'Startup Applications'.

Please do the following:

1) Create a file named autostart.sh in the ~/minimserver-0.63 directory containing the following lines:
Code:
#!/bin/sh

cd "$( dirname "$0" )"/data
java -jar ../lib/minimserver.jar --noconsole --nohup </dev/null >minimserver.out 2>&1 &

exit 0

2) Use the chmod 755 command to make the autostart.sh file executable.

3) In the Edit Startup Program dialog, change the command to:
Code:
/home/<username>/minimserver-0.63/autostart.sh
where <username> is your user name. You can't use '~' for this here.

I've tried this on Ubuntu, and it's working for me.

I'll add this autostart.sh script to the next release of MinimServer.

Thanks Simon, works like a charm. Is this generic knowledge for a Linux user?
Find all posts by this user
Quote this message in a reply
12-02-2013, 14:08
Post: #4
RE: Minimserver Autostart Ubuntu
(12-02-2013 13:44)jvilly Wrote:  Thanks Simon, works like a charm. Is this generic knowledge for a Linux user?

Some is, but some isn't. Smile

The part that isn't generic is the exact combination of options to use on the MinimServer startup command.
Find all posts by this user
Quote this message in a reply
23-11-2013, 18:18
Post: #5
RE: Minimserver Autostart Raspberry
Hi,
i have the same problem at my Raspberry. Image Raspbian Wheezy.
the file autostart.sh is already here.
Do you know what is to do here?

(I only use the terminal....)
Find all posts by this user
Quote this message in a reply
23-11-2013, 21:04
Post: #6
RE: Minimserver Autostart Ubuntu
(23-11-2013 18:18)prodigy999 Wrote:  Hi,
i have the same problem at my Raspberry. Image Raspbian Wheezy.
the file autostart.sh is already here.
Do you know what is to do here?

(I only use the terminal....)

What problem do you have exactly? The experimental build contains an autostart.sh file. Isn't this file working for you? What happens when you run autostart.sh?
Find all posts by this user
Quote this message in a reply
23-11-2013, 22:44
Post: #7
RE: Minimserver Autostart Ubuntu
(23-11-2013 18:18)prodigy999 Wrote:  Hi,
i have the same problem at my Raspberry. Image Raspbian Wheezy.
the file autostart.sh is already here.
Do you know what is to do here?

(I only use the terminal....)

I put the command line for minimserver.sh in /etc/rc.local which runs at start up.
Find all posts by this user
Quote this message in a reply
24-11-2013, 12:07
Post: #8
RE: Minimserver Autostart Ubuntu
(23-11-2013 21:04)simoncn Wrote:  What problem do you have exactly? The experimental build contains an autostart.sh file. Isn't this file working for you? What happens when you run autostart.sh?

The problem was, when i restart my pi, the minimserver will not be started automatically. (The file autostart.sh runs minimserver but not after a reboot.)

But NeilT helped:

I put following in it:
cd /home/pi/minimserver-0.72/
./autostart.sh

This worked for me. Thx.
Find all posts by this user
Quote this message in a reply
24-11-2013, 15:06 (This post was last modified: 24-11-2013 15:27 by simoncn.)
Post: #9
RE: Minimserver Autostart Ubuntu
(24-11-2013 12:07)prodigy999 Wrote:  The problem was, when i restart my pi, the minimserver will not be started automatically. (The file autostart.sh runs minimserver but not after a reboot.)

But NeilT helped:

I put following in it:
cd /home/pi/minimserver-0.72/
./autostart.sh

This worked for me. Thx.

This is how autostart.sh is intended to be used. When the Raspberry Pi build becomes official, I will include this in the instructions.

Actually, you could have just added:

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

to the /etc/rc.local file. The autostart.sh script takes care of setting the correct launch current directory.
Find all posts by this user
Quote this message in a reply
27-11-2013, 08:13
Post: #10
RE: Minimserver Autostart Ubuntu
Another way to do this is described in this article. This is the approach used by Raspbian for automatically starting most other service processes.

Here's the init.d script that I'm using on my Pi:

Code:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          minimserver
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Start MinimServer
# Description:
### END INIT INFO

MINIM_HOME=/sd1/minim/minimserver-0.72
USER=pi

case "$1" in
  start)
    su ${USER} -c "${MINIM_HOME}/autostart.sh"
    ;;
  *)
    echo "Usage: $0 start" >&2
    exit 3
    ;;
esac
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)