Post Reply 
 
Thread Rating:
  • 3 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] Installing MinimServer on FreeNAS or FreeBSD
27-06-2020, 15:08 (This post was last modified: 27-06-2020 15:10 by Hibiki.)
Post: #68
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD
So, I tried to make multiple instances within FreeNAS with the following access paths:
/usr/local/share/minimserver
/usr/local/share/minimserver-2/minimserver
/usr/local/share/minimserver-3/minimserver

I changed http.port and ohnet.port on every instances to never get the 2 same port numbers.
Is it really important for ohnet.port?

So basically, I have for the first instance:
Code:
http.port = 9790
ohnet.port = 9791

The second one:
Code:
http.port = 9792
ohnet.port = 9793

And the third one:
Code:
http.port = 9794
ohnet.port = 9795

All can be manually launched.
Then I tried to modify the script for the automatic launch at boot.

Just before, I sent the commands:
Code:
/usr/bin/sed -i -- 's/-eo pid,user,vsz,stat,args/-exo pid,user,vsz,stat,args/g' /usr/local/share/minimserver-2/minimserver/bin/stopall
/usr/bin/sed -i -- 's/-eo pid,user,vsz,stat,args/-exo pid,user,vsz,stat,args/g' /usr/local/share/minimserver-3/minimserver/bin/stopall

Then I modified the script /etc/rc.d/minimserver like this:
Code:
#!/bin/sh
#
# $FreeBSD: /usr/local/etc/rc.d/minimserver, 2020/02/03 05:55:56 isaac Exp $
#
# PROVIDE: minimserver
# KEYWORD: FreeBSD
#
# minimserver startup
#

. /etc/rc.subr

minimserver_enable=${minimserver_enable}
minimserver_flags=${minimserver_flags}

name=minimserver
rcvar=minimserver_enable
minimserver1_path=/usr/local/share/minimserver
minimserver2_path=/usr/local/share/minimserver-2/minimserver
minimserver3_path=/usr/local/share/minimserver-3/minimserver
start_cmd=minimserver_start
stop_cmd=minimserver_stop

minimserver_start() {
    PATH=${PATH}:/usr/local/sbin:/usr/local/bin
    export PATH
    LANG=en_US.UTF-8
    export LANG
    LC_CTYPE=en_US.UTF-8
    export LC_CTYPE
    LC_ALL=en_US.UTF-8
    export LC_ALL
    checkyesno minimserver_enable && echo "Starting minimserver." && \
        ${minimserver1_path}/bin/startd ${minimserver_flags}
        ${minimserver2_path}/bin/startd ${minimserver_flags}
        ${minimserver3_path}/bin/startd ${minimserver_flags}
}

minimserver_stop() {
    checkyesno minimserver_enable && echo "Stopping minimserver." && \
        ${minimserver1_path}/bin/stopall
        ${minimserver2_path}/bin/stopall
        ${minimserver3_path}/bin/stopall
}

load_rc_config ${name}
run_rc_command "$1"

And it doesn't really work... Inside the Jail when I type : service minimserver stop the first time I got (while all instances were running):
Code:
root@Minimserver:/etc/rc.d # service minimserver stop
Stopping minimserver.
Stopping MinimServer process 20226
No MinimServer instances are running
No MinimServer instances are running

Only the first instance is stopped, the two others are running...

I tried a second time:
Code:
root@Minimserver:~ # service minimserver stop
Stopping minimserver.
No MinimServer instances are running
No MinimServer instances are running
No MinimServer instances are running

No change...

With:
Code:
root@Minimserver:/etc/rc.d # service minimserver start
Starting minimserver.
Failed to start MinimServer
Failed to start MinimServer
Failed to start MinimServer

Only the first instance is starting...

When I exit the Jail and I stop the Jail (iocage stop Minimserver).
I restart the Jail (iocage start Minimserver), it starts all MinimServer instances (?!)

Where am I wrong?
When I changed
Code:
checkyesno minimserver_enable && echo "Starting minimserver." && \
        ${minimserver1_path}/bin/startd ${minimserver_flags}
        ${minimserver2_path}/bin/startd ${minimserver_flags}
        ${minimserver3_path}/bin/startd ${minimserver_flags}

to

Code:
checkyesno minimserver_enable && echo "Starting minimserver." && \
        ${minimserver1_path}/bin/startd ${minimserver_flags} &&\
        ${minimserver2_path}/bin/startd ${minimserver_flags} &&\
        ${minimserver3_path}/bin/startd ${minimserver_flags}

Nothing started at all (I thought I missed the "&&\" to split the same command on several lines).

May you help me, please?

Cheers
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [Tutorial] Installing MinimServer on FreeNAS or FreeBSD - Hibiki - 27-06-2020 15:08

Forum Jump:


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