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
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.

[attachment=114]

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'.
(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.
(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?
(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.
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....)
(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?
(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.
(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.
(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.
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
Pages: 1 2 3
Reference URL's