DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2012-07-01 03:34:25

gnugu
Member
Registered: 2008-05-08
Posts: 27

Auto start 'git daemon' with ffp 0.7

Hi,
I have DNS-323 with ffp 0.7 and git package installed.

When I telnet to the dns I can run 'git daemon --base-path=/mnt/HD_a2/git' and all works fine.

How do I set this up so it starts this command on startup?

I have /ffp/start/git.hs with a+x with the following contect:

Code:

#!/ffp/bin/sh

# PROVIDE: git

. /ffp/etc/ffp.subr

name="git"
command="/ffp/libexec/git-core"
git_flags="daemon --base-path=/mnt/HD_a2/git"

run_rc_command "$1"

But it doesn't start at all after reboot.

Could anybody please point me to the right direction how ffp 0.7 wires the startup scripts?

Thank you!

Offline

 

#2 2012-07-02 07:28:37

Stranger
Member
Registered: 2012-04-30
Posts: 26

Re: Auto start 'git daemon' with ffp 0.7

Why you run
git daemon --base-path=/mnt/HD_a2/git
from CLI
but
/ffp/libexec/git-core daemon --base-path=/mnt/HD_a2/git
from script?
What is the reason the commands are different?

Last edited by Stranger (2012-07-02 07:29:07)


D-Link DNS-343/FW1.06/4x2GB(RAID5), ffp-0.7 on USB,
full nfs-support, mc 4.8.1.756, nano 2.2.6, iStat 0.5.8, Lighttpd 1.4.39, mySQL 5.1.61, php 5.5.1-dev,
*NIX Time Machine-like backup, net-snmp 5.7.2, nut 2.6.5 (snmp-ups),
ownCloud 4.0.2, Transmission 2.81

Offline

 

#3 2012-07-02 20:31:58

gnugu
Member
Registered: 2008-05-08
Posts: 27

Re: Auto start 'git daemon' with ffp 0.7

Hi Stranger,
thanks for your suggestion. I tried that as well. Here is my git.sh:

Code:

#!/ffp/bin/sh

# PROVIDE: git

. /ffp/etc/ffp.subr

name="git"
command="git daemon --base-path=/mnt/HD_a2/git"

run_rc_command "$1"

And here is the result:

Code:

git pull origin master
fatal: unable to connect to 192.168.1.129:
192.168.1.129[0: 192.168.1.129]: errno=Connection refused

I suspect my .sh is not written correctly. Is there a help/wiki that describes how those .sh files should be written (I don't mean basic shell)?

Thanks.

Offline

 

#4 2012-07-02 21:18:26

gnugu
Member
Registered: 2008-05-08
Posts: 27

Re: Auto start 'git daemon' with ffp 0.7

Got it!!!!
I downloaded mysql package and untarred it on my host. From there I learned that git package hase /ffp/start/gitd.sh missing.
Create gitd.sh (a+x) file in /ffp/start and make sure it looks like this from inside:

Code:

#!/ffp/bin/sh

# PROVIDE: gitd
# REQUIRE: LOGIN

. /ffp/etc/ffp.subr

name="gitd"
start_cmd="gitd_start"
stop_cmd="gitd_stop"
status_cmd="gitd_status"

gitd_flags="--reuseaddr --enable=receive-pack --informative-errors --export-all --base-path=/mnt/HD_a2/git /mnt/HD_a2/git"

gitd_start() {
  /ffp/libexec/git-core/git-daemon $gitd_flags &
}

gitd_stop()
{
    proc_stop gitd
}

gitd_status()
{
    proc_status gitd
}

run_rc_command "$1"

Of course your base path may differ.

If anybody knows how to contribute to funplug packages, please pass this up there.

Last edited by gnugu (2012-07-02 21:56:52)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB