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 2010-05-07 12:59:52

Bearinator
New member
Registered: 2010-05-07
Posts: 2

Script Errors for Avahi and Netatalk with FFP

I am trying to get Avahi (Bonjour) and Netatalk (AFP) up and running on my FFP 0.5 install (DNS-321).  I followed  this guide from Avinash

My problem is that I run into script errors for /ffp/start/avahi.sh and /ffp/start/afpd.sh and the problem seems to be related to the PROVIDE: and REQUIRE part of the scripts.  Since I know very little about scripting, I'm not even sure what these lines do.

The code for avahi.sh:

Code:

#!/ffp/bin/sh

# PROVIDE: avahi
# REQUIRE: SERVERS

. /mnt/HD_a2/ffp/etc/ffp.subr

name="avahi"
command="/ffp/sbin/avahi-daemon"
avahi_daemon_flags="-D -s"
required_files="/ffp/etc/avahi/avahi-daemon.conf /ffp/etc/avahi/hosts"

start_cmd="avahi_start"

avahi_start()
{
    # need avahi user and group for priviledge separation
    if ! grep '^avahi:' /etc/passwd >/dev/null; then
            echo 'avahi:x:50:50:Avahi Daemon:/no/where:/bin/false' >>/etc/passwd
    fi
    if ! grep '^avahi:' /etc/shadow >/dev/null; then
            echo 'avahi:*:14493:0:99999:7:::' >>/etc/shadow
    fi
    if ! grep '^avahi:' /etc/group >/dev/null; then
            echo 'avahi::50:avahi' >>/etc/group
    fi

    proc_start $command
}

run_rc_command "$1"

The code for afpd.sh:

Code:

#!/ffp/bin/sh

# PROVIDE: afpd
# BEFORE: 
# REQUIRE: 

. /ffp/etc/ffp.subr

name="afpd"
start_cmd="afpd_start"
stop_cmd="afpd_stop"
status_cmd="afpd_status"

afpd_start()
{
    /ffp/sbin/afpd
}

afpd_stop()
{
    killall afpd
}

afpd_status()
{
    ps -A | grep /ffp/sbin/afpd | grep -v grep
}

run_rc_command "$1"

My ffp startup log:

Code:

ln -snf /mnt/HD_a2/ffp /ffp
* Running /ffp/etc/fun_plug.init …
* Running /ffp/etc/rc …
rcorder: requirement `SERVERS
‘ in file `/ffp/start/avahi.sh’ has no providers.
rcorder: requirement `
‘ in file `/ffp/start/afpd.sh’ has no providers.
* /ffp/start/syslogd.sh inactive
* /ffp/start/SERVERS.sh inactive
* /ffp/start/portmap.sh inactive
* /ffp/start/unfsd.sh inactive
* /ffp/start/nfsd.sh inactive
* /ffp/start/ntpd.sh inactive
* /ffp/start/smartd.sh inactive
* /ffp/start/LOGIN.sh inactive
* /ffp/start/telnetd.sh inactive
* /ffp/start/svnserve.sh inactive
* /ffp/start/sshd.sh …
Starting /ffp/sbin/sshd
* /ffp/start/rsyncd.sh inactive
* /ffp/start/mysqld.sh inactive
* /ffp/start/mediatomb.sh inactive
* /ffp/start/kickwebs.sh inactive
* /ffp/start/lighttpd.sh inactive
* /ffp/start/inetd.sh inactive
* /ffp/start/dnsmasq.sh inactive
* /ffp/start/btpd.sh inactive
* /ffp/start/avahi.sh …
/ffp/etc/rc: line 45: /ffp/start/avahi.sh: not found
* /ffp/start/afpd.sh …
/ffp/etc/rc: line 45: /ffp/start/afpd.sh: not found
* OK

The errors I get if I try to start the scripts from command line:

Code:

sh avahi.sh start
: not foundine 2:
: not foundine 5:
avahi.sh: .: line 6: can’t open /mnt/HD_a2/ffp/etc/ffp.subr

sh afpd.sh start
: not foundne 2:
: not foundne 6:
afpd.sh: .: line 7: can’t open /ffp/etc/ffp.subr

I'm not really sure what is going on.  Permissions are right on all of the files involved in the equation.

Any ideas?

Last edited by Bearinator (2010-05-07 13:02:25)

Offline

 

#2 2010-05-07 13:24:58

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Script Errors for Avahi and Netatalk with FFP

What editor did you use to create those files? Are you aware of the different Windows and Unix line-break conventions?
If you used a Windows Editor, try the following commands to fix the start scripts (in a telnet session):

Code:

cd /ffp/start
mv avahi.sh avahi.sh.dos
cat avahi.sh.dos | dos2unix >avahi.sh

mv afpd.sh afpd.sh.dos
cat afpd.sh.dos | dos2unix >afpd.sh

While this fix your start scripts, you may have similar problems with the other files you created. You should get an Editor that supports UNIX conventions.

Offline

 

#3 2010-05-07 14:03:19

Bearinator
New member
Registered: 2010-05-07
Posts: 2

Re: Script Errors for Avahi and Netatalk with FFP

This fixed it -- amateur mistake on my part.  Thanks fonz!

I used notepad++ -- it supports unix, I just didn't pay attention to it.  I learned my lesson though, vi for now on.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB