Solved [Solved] Diaspora on boot

Hi everyone,

I'm trying to make diaspora start on boot. Here is the base command line :

Code:
$ cd ~/diasporadir
$ ./script/server

I have two leads :

1. Using /etc/rc.local, but it does not working. I can see the boot is very long, but there is no process. I think this is because the script runs before mysql (which is required).

2. Making my own /usr/local/etc/rd.d/diaspora script, but I don't know if it's possible for a rc.d script to call another script. Here is what I tried :

Code:
#!/bin/sh
# PROVIDE: diaspora
# REQUIRE: mysql redis LOGIN
#
. /etc/rc.subr

name="diaspora"
diaspora_user=diaspora
command="/home/diaspora/diaspora/script/server"
start_cmd="diaspora_start"

diaspora_start()
{
        su -l ${diaspora_user} -c ${command}
}

Yes, I want this rc.d script to execute /home/diaspora/diaspora/script/server with diaspora user.

When I run /usr/local/etc/rc.d/diaspora start, nothing happens at all.

I admit, I'm stuck, can you help me?

Thanks.
 
Re: Diaspora on boot

Is your disapora directory diasporadir as you have in the command line code tag or dispora (as you have in the ./rc.d/diapsora script?

Using service(8) is the preferred way to start|stop services, for example service diaspora start.
 
Re: Diaspora on boot

Hello trh411, thanks for your answer.
I had a look at redis rc.d script, and it did helped me.
Here is my script, a bit dirty, but it works (and quietly) :

Code:
#!/bin/sh
#
#
# PROVIDE: diaspora
# REQUIRE: MYSQL LOGIN
. /etc/rc.subr

name="diaspora"
rcvar=diaspora_enable
command="/home/diaspora/diaspora/script/server"

load_rc_config "$name"
: ${diaspora_enable="NO"}
: ${diaspora_user="diaspora"}

command_args="&> /dev/null"

run_rc_command "$1"

Anyway thanks for the tips with service(), I will have a look.

That topic is solved.
 
Back
Top