Erstellt vor 4 Jahren

Zuletzt geändert vor 3 Jahren

#2431 assigned addition

Webinterface for ndas

Erstellt von: RomMon Verantwortlicher:
Priorität: low Meilenstein: freetz-next
Komponente: webinterface Version: devel
Stichworte: Beobachter:
Product Id: Firmware Version:

Beschreibung

Created a webinterface for package ndas.

See also the following forum thread: http://www.ip-phone-forum.de/showthread.php?t=268796

Created the following 3 files:
./ndas/files/root/etc/default.ndas/ndas.cfg
./ndas/files/root/etc/init.d/rc.ndas
./ndas/files/root/usr/lib/cgi-bin/ndas.cgi

These files should work with trunk revision 11874 and later.

Anhänge (20)

ndas.cfg (794 Byte) - hinzugefügt von RomMon vor 4 Jahren.
default configuration
ndas.cgi (2.4 KB) - hinzugefügt von RomMon vor 4 Jahren.
web interface
rc.ndas (3.9 KB) - hinzugefügt von RomMon vor 4 Jahren.
rc script
external.in (176 Byte) - hinzugefügt von RomMon vor 4 Jahren.
external.files (84 Byte) - hinzugefügt von RomMon vor 4 Jahren.
external.services (73 Byte) - hinzugefügt von RomMon vor 4 Jahren.
ndas_gui.patch (8.0 KB) - hinzugefügt von RomMon vor 4 Jahren.
created from ~/freetz-trunk/make with diff -durN ndas-orig ndas
trunk-11986_ndas_web-interfac_external.services.diff (8.7 KB) - hinzugefügt von RomMon vor 4 Jahren.
New patch file containting all mssing files in trunk-revison 11986
trunk-12301-ndas_web-interface_external.services.patch (10.1 KB) - hinzugefügt von RomMon vor 4 Jahren.
new patch for trunk-revision 12301
trunk-12494-ndas_web-interface_external.services.patch (11.9 KB) - hinzugefügt von RomMon vor 4 Jahren.
new patch for trunk-revision 12494
trunk-12755-ndas_web-interface_external.services.patch (12.4 KB) - hinzugefügt von RomMon vor 4 Jahren.
new patch for trunk-revision 12755
trunk-12764-ndas_web-interface_external.services.patch (12.4 KB) - hinzugefügt von RomMon vor 4 Jahren.
Diff agains trunk revision 12764
EN_ndas_webinterface.png (31.7 KB) - hinzugefügt von RomMon vor 4 Jahren.
English version of the web-interface
DE_ndas_webinterface.png (32.5 KB) - hinzugefügt von RomMon vor 4 Jahren.
German version of the web-interface
trunk-12791-ndas_web-interface_external.services.patch (12.4 KB) - hinzugefügt von RomMon vor 4 Jahren.
Diff agains trunk revision 12791, with translation corrections
ndas_webif_rc_er13.patch (10.0 KB) - hinzugefügt von er13 vor 4 Jahren.
trunk-12842-ndas_web-interface_v2.patch (7.6 KB) - hinzugefügt von RomMon vor 4 Jahren.
NDAS web-interface (v2) requesting mount-point-path only
EN_ndas_webinterface_v2.png (34.4 KB) - hinzugefügt von RomMon vor 4 Jahren.
Ndas web-interface v2
trunk-12864-ndas_web-interface_v2.patch (4.7 KB) - hinzugefügt von RomMon vor 4 Jahren.
Ndas web-interface mounting partitions without user input
trunk-13011-ndas_web-interface_v3_2.patch (5.9 KB) - hinzugefügt von RomMon vor 3 Jahren.
Using do_mount and do_umount from libmodmount

Alle Anhänge herunterladen als: .zip

Änderungshistorie (74)

Geändert vor 4 Jahren durch RomMon

default configuration

Geändert vor 4 Jahren durch RomMon

web interface

Geändert vor 4 Jahren durch RomMon

rc script

Geändert vor 4 Jahren durch RomMon

Geändert vor 4 Jahren durch RomMon

Geändert vor 4 Jahren durch RomMon

comment:1 Geändert vor 4 Jahren durch RomMon

Adding files to externalize the binary ndasadmin (~28kB).

comment:2 Geändert vor 4 Jahren durch er13

@RomMon: could you please provide all your changes as a patch. Thanks.

comment:3 Geändert vor 4 Jahren durch er13

In 11958:

ndas:

  • add support for external (by RomMon)
  • refs #2431

Geändert vor 4 Jahren durch RomMon

created from ~/freetz-trunk/make with diff -durN ndas-orig ndas

comment:4 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Thanks for working on this ticket.

In 11958 I'm missing the file external.services​

I created a patch containing the 3 files for the gui.

./ndas/files/root/etc/default.ndas/ndas.cfg
./ndas/files/root/etc/init.d/rc.ndas
./ndas/files/root/usr/lib/cgi-bin/ndas.cgi

ndas_gui.patch is created with "diff -durN ndas-orig ndas"

comment:5 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Added a patch against svn from checkout revision 11986.
The patch contains:

./make/ndas/files/root/etc/default.ndas/ndas.cfg
./make/ndas/files/root/etc/init.d/rc.ndas
./make/ndas/files/root/usr/lib/cgi-bin/ndas.cgi
./make/ndas/external.services

Geändert vor 4 Jahren durch RomMon

New patch file containting all mssing files in trunk-revison 11986

comment:6 Geändert vor 4 Jahren durch RomMon

Just wonder if additional work is needed before this can be added to trunk?

comment:7 Geändert vor 4 Jahren durch RomMon

Working on an update with better mount behavior, a workaround for an issue created by a zero size /mod/etc/ndas.conf on a 7390.
Also including lang statements for DU and EN languages.

I found the following translations, maybe someone can have a look if these are ok:

$(lang de:"Starttyp" en:"Start type")
$(lang de:"Automatisch" en:"Automatic")
$(lang de:"Manuell" en:"Manual")
$(lang de:"Anzahl der Partitionen" en:"Number of Partitions")
$(lang de:"NDAS Geräte ID" en:"Register ID")
$(lang de:"SchreibSchlüssel" en:"Register Key")
$(lang de:"Festplatten-Zugriffsberechtigungs" en:"Disk Access Privilege")
$(lang de:"Lesezugriff" en:"Read only access")
$(lang de:"Readwrite-Zugriff" en:"Read Write access")
$(lang de:"Kernmodul aktiviert für die Schnittstelle" en:"Core module enabled for interface")
$(lang de:"Mount-Befehl partiontion nda$i" en:"Mount command partiontion nda$i")
$(lang de:"Neustart den Samba-Dienst" en:"Restart the Samba service")
$(lang de:"Neustart den NFS-Dienst" en:"Restart the NFS service")

Hope to attach a new patch file in a few days.

Geändert vor 4 Jahren durch RomMon

new patch for trunk-revision 12301

comment:8 Geändert vor 4 Jahren durch RomMon

Added a patch containing the following files:

A         make/ndas/files
A         make/ndas/files/root
A         make/ndas/files/root/usr
A         make/ndas/files/root/usr/lib
A         make/ndas/files/root/usr/lib/cgi-bin
A         make/ndas/files/root/usr/lib/cgi-bin/ndas.cgi
A         make/ndas/files/root/etc
A         make/ndas/files/root/etc/init.d
A         make/ndas/files/root/etc/init.d/rc.ndas
A         make/ndas/files/root/etc/default.ndas
A         make/ndas/files/root/etc/default.ndas/ndas.cfg
A         make/ndas/files/.language
A         make/ndas/external.services

comment:9 Geändert vor 4 Jahren durch er13

Hi RomMon,

sorry for not responding earlier. I've seen/read your PN but then somehow forgot to respond, sorry.

As to the patch.

  • what's the reason some of the variables have 1 (one) at the end of their names (NDAS_NETDISKPARTITIONS1, NDAS_READONLYREADWRITE1). what is ndas-01? some magic name? could you please add a variable for it?
  • is it possible to check if a module could successfully be loaded right after the corresponding modprobe instead of this strange [ "3" != "$(grep ^ndas /proc/modules | wc -l)" ].
  • please check if samba/nfs are available and do not offer the options to restart them if they are not.
  • could you please eliminate the code-clones in this fragment
    if [ -e "/proc/ndas/devs" ] && [ "$(cat /proc/ndas/devs | wc -l)" -ge "2" ]; then 
      disknumber=$(awk '$1 == "ndas-01" { print $7 }' /proc/ndas/devs) 
      [ -n "$disknumber" ] && [ $(awk '$1 == "ndas-01" { print $6 }' /proc/ndas/devs) == "Online" ] \ 
        && /usr/bin/ndasadmin disable -s $disknumber 
      [ -n "$disknumber" ] && [ $(awk '$1 == "ndas-01" { print $6 }' /proc/ndas/devs) == "error" ] \ 
        && /usr/bin/ndasadmin disable -s $disknumber  
      [ -n "$disknumber" ] && [ $(awk '$1 == "ndas-01" { print $6 }' /proc/ndas/devs) == "Offline" ] \ 
        && /usr/bin/ndasadmin disable -s $disknumber  
    fi 
    
  • please split start in config & start
  • please make use of modlib_*-functions, e.g. modlib_start $NDAS_ENABLED instead of [ "$NDAS_ENABLED" == "yes" ] && start || echo "ndas is disabled."
  • could you please add some comments, in particular to the "magic" lines like "$(cat /proc/ndas/devs | wc -l)" -ge "2" (why ≥ 2)

Thanks!

Best,
Gene

comment:10 Antwort: Geändert vor 4 Jahren durch RomMon

Hi Gene,

Thanks for looking into this.

  1. reason for having a 1 at the end of the names is that ndas does support multiple disks for later kernel versions (this kernel version contains a bug, and doesn't properly support multiple Netdisks).
    And ndas-01 is a 'suggested' name for the first Netdisk. Do you mean a variable at the beginning of rc.ndas script? (e.g. NDASName=ndas-01)

  2. so for each module
    if grep -q ^ndas_block /proc/modules; then
    msg=”ndas module ndas_block not loaded”
    echo “failed:$msg”
    exit 1
    
  3. if [-e /mod/etc/init.d/rc.samba]
    if [-e /mod/etc/init.d/rc.nfsd]

  4. (not sure yet)

  5. Do you have a good example package that has a config web-page, and start web-page?

  6. I looked at the modlib_start function before, but ndas is not a daemon. And if I remember correctly, due to this the function modlib_check_running didn’t work.

  7. Will add some comments in the rc.ndas script file. Reason for ≥ 2 is because the first line is a header line. The second line is the first registered netdisk.

comment:11 als Antwort auf: ↑ 10 Geändert vor 4 Jahren durch er13

Replying to RomMon:

  1. Do you mean a variable at the beginning of rc.ndas script?

yes



  1. so for each module
    if grep -q ^ndas_block /proc/modules; then
    msg=”ndas module ndas_block not loaded”
    echo “failed:$msg”
    exit 1
    

I was actually thinking of something like

modprobe ndas_module1 || my_exit1_function_echoing_failed_and_the_reason "ndas_module1 could not be loaded"
modprobe ndas_module2 MODULE2_PARAMS || my_exit1_function_echoing_failed_and_the_reason "ndas_module2 could not be loaded"
...

my_exit1_function_echoing_failed_and_the_reason could be reused for the other exit1-cases you have.



  1. if [-e /mod/etc/init.d/rc.samba]
    if [-e /mod/etc/init.d/rc.nfsd]

yes



  1. (not sure yet)

something like

if [ -e "/proc/ndas/devs" ] && [ "$(cat /proc/ndas/devs | wc -l)" -ge "2" ]; then 
  disknumber=$(awk '$1 == "ndas-01" { print $7 }' /proc/ndas/devs) 
  if [ -n "$disknumber" ]; then
    status=$(awk '$1 == "ndas-01" { print $6 }' /proc/ndas/devs)
    if [ "$status" = "Online" -o "$status" = "error" -o "$status" = "Offline" ]; then
       /usr/bin/ndasadmin disable -s $disknumber
    fi
  fi
fi 

awk '$1 == "ndas-01" { print $(SHOULD_BE_PASSED_AS_PARAMETER) }' /proc/ndas/devs could even be factored out.



  1. Do you have a good example package that has a config web-page, and start web-page?

What do you mean by start web-page? I was talking about the start- & config-functions in rc.ndas



  1. I looked at the modlib_start function before, but ndas is not a daemon. And if I remember correctly, due to this the function modlib_check_running didn’t work.

Hmm, what is then ndasadmin start & ndas_sal?



  1. Will add some comments in the rc.ndas script file. Reason for ≥ 2 is because the first line is a header line. The second line is the first registered netdisk.

Ok, thanks.

comment:12 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Hopefully you can give a hint for the following.

For point 1. I'm struggling with replacing the "ndas-01" string:

# echo $NDASName
ndas-01
# awk '$1 == "ndas-01" { print $7 }' /proc/ndas/devs
1

# awk '$1 == "$NDASName" { print $7 }' /proc/ndas/devs
# awk '$1 == $NDASName { print $7 }' /proc/ndas/devs
# awk '$1 == $(NDASName) { print $7 }' /proc/ndas/devs
# awk '$1 == $$NDASName { print $7 }' /proc/ndas/devs
# awk '$1 == $($NDASName) { print $7 }' /proc/ndas/devs
# awk '$1 == "$(echo $NDASName)" { print $7 }' /proc/ndas/devs

comment:13 Geändert vor 4 Jahren durch er13

awk '$1 == "'"$NDASName"'" { print $7 }' /proc/ndas/devs

It would probably be better to write a function like

# $1 - NDAS name
# $2 - column index
getColumnValueImpl() {
    awk '$1 == "'"$1"'" { print $'"$2"' }' /proc/ndas/devs
}

and then reuse it like

getStatus() {
    getColumnValueImpl "$NDASName" 6
}

getDiskNumber() {
    getColumnValueImpl "$NDASName" 7
}

This way you don't have to comment anything as the function names are the comments ;-)

comment:14 Antwort: Geändert vor 4 Jahren durch RomMon

Hi Gene,

I think I misunderstand your last comment about reuse the getColumnValueImpl function.

From your comment I exected the following to work:

        disknumber () {
               getDeviceColumnValue "$NDASName" 7
        }
        echo disknumber is $disknumber                                                  # test line

But it didn't return the value.

The following did work.

        disknumber=$(getDeviceColumnValue "$NDASName" 7)                                # obtain the ndas disknumber
        echo disknumber is $disknumber                                                  # test line

comment:15 als Antwort auf: ↑ 14 Geändert vor 4 Jahren durch er13

Replying to RomMon:

From your comment I exected the following to work:

        disknumber () {
               getDeviceColumnValue "$NDASName" 7
        }
        echo disknumber is $disknumber                                                  # test line

But it didn't return the value.

The last line should read

    echo disknumber is $(disknumber)

disknumber is a function and not a variable, in order to use its value as a parameter to another command you should call it within a subshell.

comment:16 Geändert vor 4 Jahren durch RomMon

Hi Gene,

I'm curious how much of your recommendations I correctly applied.

Some comments:

  1. is in ndas.cgi

4.

  1. I only moved the creation of device nodes in the config function. Loading the kernel modules is something I think should be part of the start function, but e.g. it is not possible to register a netdisk before the kernel modules are loaded.

  2. After ndasadmin start there is no pid. ndasadmin communicate with the kernel modules via the character device /dev/ndas
    Am I wrong that modlib_check_running will not work?

Edit 18-09 23:30
Change function getColumnValue to include 'input file' as additional parameter, and re-used it on two additional places.

#!/bin/sh

DAEMON=ndas

. /etc/init.d/modlibrc

NDAS_CONF=/mod/etc/ndas.conf
NDASName=ndas-01

showFailMessage () {
# function to display a failure message and exit with return code 1.
# $1 - fauluremessage to display.
        echo "failed:$1"
        exit 1
}

getColumnValue () {
# function to return a status value from the specified input file.
# $1 - NDASname
# $2 - Column index
# $3 - Input file e.g. /proc/ndas/devs or /proc/modules
        awk '$1 == "'"$1"'" { print $'"$2"' }' $3
}

config () {
        [ ! -c /dev/ndas ] && mknod -m 644 /dev/ndas c 60 0             # if character device /dev/ndas doesn't exist create the device node
        [ ! -b /dev/nda ] && mknod -m 644 /dev/nda b 60 0               # if block device /dev/nda doesn't exist create the device node
        partition=1
        while [ $partition -le "$NDAS_NETDISKPARTITIONS1" ]             # create a block device for each partition on the Netdisk
        do
                [ ! -b /dev/nda${partition} ] && mknod -m 644 /dev/nda${partition} b 60 $partition
                let partition++
        done
}

start() {
        config
        modprobe ndas_sal || showFailMessage "ndas module ndas_sal could not be loaded"                         # Load system abstraction layer implementation for NDAS technology
        [ -n "$NDAS_DEVICE" ] && NDAS_CORE_PARAM="ndas_dev=$NDAS_DEVICE" || NDAS_CORE_PARAM=""                  # Parameter for ndas_core to limit ndas enabled interfaces
        modprobe ndas_core $NDAS_CORE_PARAM || showFailMessage "ndas module ndas_core could not be loaded"      # Load the NDAS core functions
        modprobe ndas_block || showFailMessage "ndas module ndas_block could not be loaded"                     # Load the block device implementation for NDAS
        if [ -z $NDAS_REGISTERID1 ]; then
                showFailMessage "No Netdisk configured to register"
        fi
        admin_active () {
                getColumnValue "ndas_sal" 3 /proc/modules                                                       # obtain number of dependencies of kernel-module ndas_sal
        }
        [ "$(admin_active)" -le "2" ] && /usr/bin/ndasadmin start                                                                       # if number of dependencies is 2 or below ndas is not yet running
        [ ! -e "$NDAS_CONF" ] && [ $NDAS_READONLYREADWRITE1 == 'w' ] \
                && /usr/bin/ndasadmin register $NDAS_REGISTERID1-$NDAS_REGISTERKEY1 --name $NDASName | sed '/^$/d' | head -n 1          # for read-write register the Netdisk with register id and key
        [ ! -e "$NDAS_CONF" ] && [ $NDAS_READONLYREADWRITE1 == 'r' ] \
                && /usr/bin/ndasadmin register $NDAS_REGISTERID1 --name $NDASName | sed '/^$/d' | head -n 1                             # for read-only register the Netdisk with register id only
        if [ ! -e "$NDAS_CONF" ]; then
                showFailMessage "netdisk not registered"
        fi
        count=1                                                                         # allow some time for the netdisk to be found
        while [ "$(tail -1 /proc/ndas/devs | awk '{ print $6 }')" == "N/A" ] && [ "$count" -lt 5 ]; do
                let count++
                sleep 1
        done
        disknumber () {
                getColumnValue "$NDASName" 7 /proc/ndas/devs                    # obtain the ndas disknumber
        }
        [ -n "$(disknumber)"  ] && [ $NDAS_READONLYREADWRITE1 == 'w' ] \
                && /usr/bin/ndasadmin enable -s $(disknumber) -o w 2>&1 | head -n 1     # enable Netdisk with disknumber $NDASName with read-write access
        [ -n "$(disknumber)" ] && [ $NDAS_READONLYREADWRITE1 == 'r' ] \
                && /usr/bin/ndasadmin enable -s $(disknumber) -o r 2>&1 | head -n 1     # enable Netdisk with disknumber $NDASName with read-only access
        partition=1
        while [ $partition -le "$NDAS_NETDISKPARTITIONS1" ]                             # for each partition determine the device and mountpoint from each mount instruction, create the
        do
                v=NDAS_MOUNTINSTRUCTION$partition
                eval ndas_mountinstruction=\$$v
                if [ -n "$ndas_mountinstruction" ]; then
                        for m in $ndas_mountinstruction
                                do
                                        if [ "${m:0:5}" == "/dev/" ]; then
                                                mountdevice=$m
                                        fi
                                done
                        mountpoint=$m
                        [ ! -d $mountpoint ] && mkdir -p $mountpoint                    # if mountpoint doesn't exist yet create it
                        mounted=$(mount | grep $mountdevice)
                        [ -z "$mounted" ] && $ndas_mountinstruction                     # the the partition is not yet mounted, execute mount instruction
                fi
                let partition++
        done
        [ "$NDAS_RESTART_SMB" == 'yes' ] && /etc/init.d/rc.samba restart                # if selected, restart Samba server
        [ "$NDAS_RESTART_NFS" == 'yes' ] && /etc/init.d/rc.nfsd restart                 # if selected, restart NFS server
}

stop() {
        partition=1
        while [ $partition -le "$NDAS_NETDISKPARTITIONS1" ]                             # for each partition determint the device and unmount the device
        do
                v=NDAS_MOUNTINSTRUCTION$partition
                eval ndas_mountinstruction=\$$v
                if [ -n "$ndas_mountinstruction" ]; then
                        for i in $ndas_mountinstruction
                                do
                                        if [ "${i:0:5}" == "/dev/" ];then
                                                mountdevice=$i
                                        fi
                                done
                        mounted=$(mount | grep $mountdevice)
                        [ -n "$mounted" ] && umount $mountdevice                        # if mounted, unmount the device
                fi
                let partition++
        done
        if [ -e "/proc/ndas/devs" ] && [ "$(cat /proc/ndas/devs | wc -l)" -ge "2" ]; then
                disknumber () {
                        getColumnValue "$NDASName" 7 /proc/ndas/devs                    # obtain the ndas disknumber
                }
                if [ -n "$(disknumber)" ]; then
                        diskstatus () {
                                getColumnValue  "$NDASName" 6 /proc/ndas/devs           # obtain the ndas diskstatus
                        }
                        if [ "$(diskstatus)" = "Online" -o "$(diskstatus)" = "error" -o "$(diskstatus)" = "Offline" ]; then
                                /usr/bin/ndasadmin disable -s $(disknumber)
                        fi
                fi
        fi
        [ -c /dev/ndas ] && /usr/bin/ndasadmin stop                                     # if characterdevice exist stop Ndas
        modprobe -r ndas_block                                                          # remove ndas_block kernel module
        [ -e "$NDAS_CONF" ] && [ ! -s "$NDAS_CONF" ] && rm $NDAS_CONF                   # for big-endian FB delete the ndas config file if it has a zero size
}

status() {
        admin_active () {
                getColumnValue "ndas_sal" 3 /proc/modules                               # obtain number of dependencies of kernel-module ndas_sal
        }
        [ -z "$(admin_active)" ] && admin_active=0
        [ -e "$NDAS_CONF" ] && [ "$(admin_active)" -gt "2" ] && return 0
        return 1
}

case $1 in
        ""|load)
                modreg cgi 'ndas' 'ndas'
                modreg daemon ndas

                [ "$NDAS_ENABLED" == "yes" ] && start || echo "ndas is disabled."
                ;;
        unload)
                modunreg daemon ndas
                nodunreg cgi 'ndas'
                stop
                ;;
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
        status)
                status && echo running || echo stopped
                ;;
        *)
                echo "Usage: $0 [load|unload|start|stop|restart|status]" 1>&2
                exit 1
                ;;
esac

exit 0
Zuletzt geändert vor 4 Jahren von RomMon (vorher) (Diff)

Geändert vor 4 Jahren durch RomMon

new patch for trunk-revision 12494

comment:17 Geändert vor 4 Jahren durch RomMon

Hi Gene,

I created a new patch file with the latest changes.

The patch contains the following files:

A         make/ndas/files
A         make/ndas/files/root
A         make/ndas/files/root/usr
A         make/ndas/files/root/usr/lib
A         make/ndas/files/root/usr/lib/cgi-bin
A         make/ndas/files/root/usr/lib/cgi-bin/ndas.cgi
A         make/ndas/files/root/etc
A         make/ndas/files/root/etc/init.d
A         make/ndas/files/root/etc/init.d/rc.ndas
A         make/ndas/files/root/etc/default.ndas
A         make/ndas/files/root/etc/default.ndas/ndas.cfg
A         make/ndas/files/.language
A         make/ndas/external.services

comment:18 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Created a new patch which replaces all previous patches.
(don't see an option to delete older attachments)

Included files:

A         make/ndas/files
A         make/ndas/files/root
A         make/ndas/files/root/usr
A         make/ndas/files/root/usr/lib
A         make/ndas/files/root/usr/lib/cgi-bin
A         make/ndas/files/root/usr/lib/cgi-bin/ndas.cgi
A         make/ndas/files/root/etc
A         make/ndas/files/root/etc/init.d
A         make/ndas/files/root/etc/init.d/rc.ndas
A         make/ndas/files/root/etc/default.ndas
A         make/ndas/files/root/etc/default.ndas/ndas.cfg
A         make/ndas/files/.language
A         make/ndas/external.services

Geändert vor 4 Jahren durch RomMon

new patch for trunk-revision 12755

comment:19 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Found a small error.
(again, don't know how to delete the older attachments, but only this one is needed)

Included files:

A         make/ndas/files
A         make/ndas/files/root
A         make/ndas/files/root/usr
A         make/ndas/files/root/usr/lib
A         make/ndas/files/root/usr/lib/cgi-bin
A         make/ndas/files/root/usr/lib/cgi-bin/ndas.cgi
A         make/ndas/files/root/etc
A         make/ndas/files/root/etc/init.d
A         make/ndas/files/root/etc/init.d/rc.ndas
A         make/ndas/files/root/etc/default.ndas
A         make/ndas/files/root/etc/default.ndas/ndas.cfg
A         make/ndas/files/.language
A         make/ndas/external.services

Geändert vor 4 Jahren durch RomMon

Diff agains trunk revision 12764

comment:20 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Can you verify if patch 'trunk-12764-ndas_web-interface_external.services.patch​' can be added to trunk?

comment:21 Geändert vor 4 Jahren durch er13

@RomMon: I'll take a look at it. Not sure when exactly, but I'll do. I assume it works for you as I don't the corresponding hardware, i.e. unable to really test it except for the web-if.

@devs: could some of the German native speakers please check the German translation, I believe it needs to be adjusted a bit. Thanks!

Geändert vor 4 Jahren durch RomMon

English version of the web-interface

Geändert vor 4 Jahren durch RomMon

German version of the web-interface

comment:22 Geändert vor 4 Jahren durch hippie2000

@RomMon:

$(lang de:"Starttyp" en:"Start type")
$(lang de:"Automatisch" en:"Automatic")
$(lang de:"Manuell" en:"Manual")
$(lang de:"Anzahl der Partitionen" en:"Number of Partitions")
$(lang de:"NDAS Geräte ID" en:"Register ID")
$(lang de:"Schreib-Schlüssel" en:"Register Key")
$(lang de:"Festplatten-Zugriffsberechtigung" en:"Disk Access Privilege")
$(lang de:"Lesezugriff" en:"Read only access")
$(lang de:"Read/Write-Zugriff" en:"Read Write access")
$(lang de:"Kernel-Modul aktiviert für die Schnittstelle" en:"Core module enabled for interface")
$(lang de:"Mount-Befehl Partition nda$i" en:"Mount command partition nda$i")
$(lang de:"Neustart des Samba-Dienstes" en:"Restart the Samba service")
$(lang de:"Neustart des NFS-Dienstes" en:"Restart the NFS service")
Zuletzt geändert vor 4 Jahren von hippie2000 (vorher) (Diff)

comment:23 Geändert vor 4 Jahren durch RomMon

@hippie
Thanks for the corrections.

@Gene
I created a new patch with the corrections made by hippie

Same files:

A         make/ndas/files
A         make/ndas/files/root
A         make/ndas/files/root/usr
A         make/ndas/files/root/usr/lib
A         make/ndas/files/root/usr/lib/cgi-bin
A         make/ndas/files/root/usr/lib/cgi-bin/ndas.cgi
A         make/ndas/files/root/etc
A         make/ndas/files/root/etc/init.d
A         make/ndas/files/root/etc/init.d/rc.ndas
A         make/ndas/files/root/etc/default.ndas
A         make/ndas/files/root/etc/default.ndas/ndas.cfg
A         make/ndas/files/.language
A         make/ndas/external.services

Geändert vor 4 Jahren durch RomMon

Diff agains trunk revision 12791, with translation corrections

comment:24 Geändert vor 4 Jahren durch er13

  • Status von new nach assigned geändert
  • Verantwortlicher auf er13 gesetzt

Geändert vor 4 Jahren durch er13

comment:25 Geändert vor 4 Jahren durch er13

@RomMon: please find attached my version of your patch. I have not (yet) tested it on the box, so it might be terribly broken (I've adjusted a lot of code). Please review it, if possible fix all TODOs/bugs I added. Thanks!

comment:26 Geändert vor 4 Jahren durch er13

In 12799:

ndas:

  • add ability to externalize ndas kernel modules
  • refs #2431

comment:27 Geändert vor 4 Jahren durch er13

In 12800:

ndas:

  • add configuration web-if and rc.script (by RomMon with some adjustments by me)
  • WORK-IN-PROGRESS: as of now only web-if has been tested
  • refs #2431

comment:28 Geändert vor 4 Jahren durch er13

@RomMon: I've committed my version of the patch. I'm able to configure NDAS using the web-if but cannot test if the rc.script is working as I don't habe the corresponding hardware. Could you please test it and provide fixes (if necessary) and eliminate all TODOs I've added. Thanks!

comment:29 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Thanks for implementing the web-interface.
It works great.

I have looked at your todo's in rc.ndas.

1. Line 33: TODO: find a more reliable way to determine it?
ndasadmin should have implemented an option to verify Netdisk status, but currently there isn't:

# ndasadmin probe
Probing is disabled for this software release.

Fortunately using the number of dependencies of the ndas module does work reliable.

2. Line 82: TODO: very unreliable code, do it better instead of specifying the mound cmd,….
I looked at this in the past, and probably need to look at this again.
That time I decided to keep using just the mount command due to the high number of variables this would require (3 times 16 i.s.o. 16 for filesystemtype, options, mountpoint), and be more robust for future changes (e.g. ntfs).

E.g. I'm using 3 partitions:
ntfs-3g -o rw /dev/nda1 /var/media/ndas/ntfs
mount /dev/nda2 /var/media/ndas/ext3
mount /dev/nda3 /var/media/ndas/fat

3. Line 98: TODO: is it a right thing to do? should not we fail instead if the partition is already mounted
My assumption was that the rc.ndas script should be able to handle e.g. multiple starts in a row, so if a partition is already present I assume it was mounted with a previous start.

4. Line 100: TODO: what if the user specified wrong mount cmd?
The mount error will be displayed in the webinterface.

5. Line 115: TODO: rewrite me, s. comment above
(to look at)

6. Line 146: TODO: are the following three lines really necessary?
This is a workaround for big-endian devices (e.g. 7390) where the register file is not correctly written, and/or deleted. See http://freetz.org/ticket/2378#comment:4

7. Line 148: TODO: what about other modules?
The other modules are unloaded by the NDAS block module.

Happy New Year.

comment:30 Geändert vor 4 Jahren durch er13

Hi Ron,

@2: could you please test, if the filesystem type could be determined automatically using something like

blkid /dev/nda1 | sed -nr 's!.*TYPE="([^"]*).*!\1!p'

(based on the code used in libmodmount). If so, a lot of code from libmodmount could (probably) be reused. I could imagine that the only thing the user would need to specify would be the mount point.

Thanks!

Best,
Gene

comment:31 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Yes, that should work:

# blkid /dev/nda1 | sed -nr 's!.*TYPE="([^"]*).*!\1!p'
ntfs
# blkid /dev/nda2 | sed -nr 's!.*TYPE="([^"]*).*!\1!p'
ext3
# blkid /dev/nda3 | sed -nr 's!.*TYPE="([^"]*).*!\1!p'
ext2

Looking at libmodmount.sh I suspect it should be ok to do without mount options.
Big parts of libmodmount.sh look indeed re-usable, only needs more simplified.

comment:32 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Found that I didn't test the web-interface properly:

$ svn diff
Index: make/ndas/files/root/etc/init.d/rc.ndas
===================================================================
--- make/ndas/files/root/etc/init.d/rc.ndas     (revision 12845)
+++ make/ndas/files/root/etc/init.d/rc.ndas     (working copy)
@@ -122,7 +122,7 @@
                                        local mountdevice=$i
                                fi
                        done
-                       if ! grep -q "$mountdevice" /proc/mounts; then
+                       if grep -q "$mountdevice" /proc/mounts; then
                                # if mounted, unmount the device
                                umount $mountdevice
                        fi
$

comment:33 Geändert vor 4 Jahren durch RomMon

Hi Gene,

I changed the web-interface to only request the mount point path.
I reused the mount_fs fuction part of libmodmount.sh, and created a new fuction ndas_mount.

Find attached the patch file (trunk-12842-ndas_web-interface_v2.patch)

Geändert vor 4 Jahren durch RomMon

NDAS web-interface (v2) requesting mount-point-path only

comment:34 Geändert vor 4 Jahren durch er13

Hi Ron,

sorry reuse means "adjust/parameterize the original function" but not "copy the code and modify the copy". This is a classical code clone. That's the reason I'm rejecting your last patch. Please rework.

Best,
Gene

comment:35 Antwort: Geändert vor 4 Jahren durch RomMon

Do you mean I should change the functions in libmodmount.sh?

The functions do_mount and do_mount_locked don't have a parameter for the mount point path, and look very hotplug specific. And I see a few other challenges.

comment:36 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Is this what you mean?
Didn't test the changes that much yet.

$ svn diff
Index: make/mod/files/root/usr/lib/libmodmount.sh
===================================================================
--- make/mod/files/root/usr/lib/libmodmount.sh  (revision 12850)
+++ make/mod/files/root/usr/lib/libmodmount.sh  (working copy)
@@ -112,21 +112,23 @@
 # $1 - proc device (e.g. /proc/bus/usb/001/002)
 # $2 - block device name (including /dev/ prefix, e.g. /dev/sda1)
 # $3 - partition number
+# $4 - (optional) full mount pouint path
 #
 do_mount_locked() {
        local mnt_rw=rw
        [ $# -ge 2 ] && local mnt_dev=$2 || return 1
        [ $# -ge 3 ] && local mnt_part_num=$3 || return 1
+       [ $# -ge 4 ] && local mnt_path=$4
        local mnt_blk_dev=${mnt_dev##/dev/}
        local mnt_main_dev=${mnt_blk_dev:0:3}
-       local mnt_name
+       [ -z $mnt_name ] && local mnt_name
        local mnt_path
        local fs_type

        mount | grep -q "$mnt_dev on /var/media/" && return 0                      # device already mounted

        mnt_name=$(find_mnt_name $mnt_main_dev $mnt_part_num)
-       mnt_path=$FTPDIR/$mnt_name
+       mnt_path=${mnt_path:-$FTPDIR/$mnt_name}
        log_freetz notice "Mounting device $mnt_dev at $mnt_path ... "
        if [ ! -d $mnt_path ]; then
                mkdir -p $mnt_path
@@ -153,7 +155,7 @@

        umask $old_umask                                                           # restore umask

-       if [ $err_fs_mount -eq 0 ]; then
+       if [ $err_fs_mount -eq 0 ] && [ $mnt_main_dev != "nda" ]; then
                local rcftpd="/etc/init.d/rc.ftpd"
                local samba_control="/etc/samba_control"
                local fritznasdb_control="/etc/fritznasdb_control"
@@ -391,9 +393,10 @@
        local device=$1
        local mnt_dev=$2
        local mnt_part_num=$3
+       [ $# -ge 4 ] && local mnt_path=$4
        local err_code=0
        passeeren                                                                 # semaphore on
-       do_mount_locked $device $mnt_dev $mnt_part_num
+       do_mount_locked $device $mnt_dev $mnt_part_num $mnt_path
        err_code=$?
        vrijgeven                                                                 # semaphore off
        return $err_code

comment:37 Geändert vor 4 Jahren durch er13

In 12863:

ndas:

  • fix some typos, refs #2431

comment:38 als Antwort auf: ↑ 35 Geändert vor 4 Jahren durch er13

Replying to RomMon:

Do you mean I should change the functions in libmodmount.sh?

Yes, if necessary. I could think of the following two options:

  1. no special mount point is necessary (i.e. you're absolutely happy with /var/media/ftp/$(find_mnt_name ...)) → use functions from libmodmount directly (it looks like without a single adjustment, at least I don't see any).
  2. special mount point is necessary (i.e. /var/media/ftp/$(find_mnt_name ...) is not what you want) → adjust do_mount(_locked) so that it supports optional mount point, all the notifications already implemented in libmodmount-functions are still necessary (i.e. no code like [ $mnt_main_dev != "nda" ] is required).

1 would be my personal preference.

comment:39 Geändert vor 4 Jahren durch RomMon

Hi Gene,

If 1. is selected the web-interface should provide back the mount point.
(The default name is /var/media/ftp/Ustor01 for partition 1 on /dev/nda, /var/media/ftp/Ustor02 for partition 2 on /dev/nda. These are already in use, so I need to define e.g. MOD_STOR_PREFIX=NDAS, so it will become /var/media/ftp/NDAS01 for partition 1 on /dev/nda.)
Than ndas.cgi needs to display the mount point path for each partition.

In the function do_mount there is a function call to passeeren and another to vrijgeven.
Do I need to create an empty function in rc.ndas for each of these, or did I miss something and are these functions existing somewhere else?

Is the part below from libmodmount.sh not causing the Netdisks to appear at unexpected places?

        if [ $err_fs_mount -eq 0 ]; then
                local rcftpd="/etc/init.d/rc.ftpd"
                local samba_control="/etc/samba_control"
                local fritznasdb_control="/etc/fritznasdb_control"
                local tammnt="/var/tam/mount"
                local autorun="$mnt_path/autorun.sh"

                eventadd 140 "$mnt_name ($mnt_dev)"
                log_freetz notice "Partition $mnt_name ($mnt_dev) was mounted successfully ($fs_type)"

                if [ -x $rcftpd ]; then
                        [ -x "$(which inetdctl)" ] && inetdctl enable ftpd || $rcftpd start
                fi

                # freetz extras
                /etc/init.d/rc.swap autostart $mnt_path
                [ "$MOD_STOR_AUTORUNEND" == "yes" -a -x $autorun ] && $autorun &
                [ -r /mod/etc/external.pkg ] && /etc/init.d/rc.external start $mnt_path &

                [ -x $TR069START ] && $TR069START $mnt_name
                [ -x $samba_control ] && $samba_control reconfig
                [ -p $tammnt ] && echo "m$mnt_path" > $tammnt

                rm -f /var/media/NEW_LINK && ln -fs $mnt_path /var/media/NEW_LINK

                # notify other components that a new partition has been mounted
                if [ $(get_avm_firmware_version) -lt 557 ]; then
                        msgsend multid update_usb_infos
                else
                        msgsend upnpdevd update_usb_infos
                fi
                [ -e /lib/libmediasrv.so ] && msgsend upnpd plugin force_notify libmediasrv.so new_partition
                [ -e /lib/libgpmsrv.so   ] && msgsend upnpd plugin force_notify libgpmsrv.so "new_partition:$mnt_pa
                [ -x $fritznasdb_control ] && $fritznasdb_control new_partition "$mnt_path"

                [ -x "$(which led-ctrl)" ] && led-ctrl filesystem_done

                return 0
        fi


comment:40 Geändert vor 4 Jahren durch RomMon

Hi Gene,

I'm trying to implement option 1.
I have added the following two lines to 'etc/default.ndas/ndas.cfg'

export MOD_STOR_PREFIX='Ndas'
export FTPDIR='/var/media/ftp/ndas/'

a do_mount result in:

/dev/nda1 on /var/media/ftp/ndas/UStor01 type fuseblk (rw,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/nda2 on /var/media/ftp/ndas/UStor02 type ext3 (rw,noatime,nodiratime,errors=continue,data=ordered)
/dev/nda3 on /var/media/ftp/ndas/UStor03 type ext2 (rw,noatime,nodiratime,errors=continue)

So the 'FTPDIR' variable is correctly used, but 'MOD_STOR_PREFIX' gets cleared after the line . /usr/lib/libmodmount.sh is executed at the beginning of 'rc.ndas'.

Adding the line export MOD_STOR_PREFIX='Ndas' after the line . /usr/lib/libmodmount.sh in ‘rc.ndas’ prevents this variable to be cleared (i.s.o. in ndas.cfg).
I'm trying to understand if this is an issue, or if having the export in rc.ndas is ok?

comment:41 Geändert vor 4 Jahren durch RomMon

Hi Gene,

Already found a solution.

Added the following to 'etc/default.ndas/ndas.cfg'

export NDAS_STOR_PREFIX='Ndas'
export NDAS_FTPDIR='/var/media/ftp/ndas/'

In rc.ndas before the do_mount function is called:

MOD_STOR_PREFIX="$NDAS_STOR_PREFIX"
FTPDIR="$NDAS_FTPDIR"

comment:42 Geändert vor 4 Jahren durch er13

Great, this is almost the solution I was thinking of.

I would say overriding FTP_DIR is not necessary. You should introduce NDAS_STOR_PREFIX and override it right after including libmodmount. Don't forget to check if NDAS_STOR_PREFIX is not equal to MOD_STOR_PREFIX (report an error and stop mounting ndas-devices if they are equal).

Replying to RomMon:

In the function do_mount there is a function call to passeeren and another to vrijgeven. Do I need to …?

These are AVM functions (written by some AVM employee of Dutch descent ;-)), they are located in one the AVM files. You just need to include it (in case of the other use-case they are included by the file including libmodmount, that's the reason libmodmount doesn't include it). Unfortunately, I cannot access my box and my development environment right now, I'll provide you the name of the AVM file later.

Is the part below from libmodmount.sh not causing the Netdisks to appear at unexpected places?

I was thinking it would be Ok to call the same code, but after looking at the code you qouted I'm not that sure any more, I'll take a closer look into it.

Geändert vor 4 Jahren durch RomMon

Ndas web-interface v2

Geändert vor 4 Jahren durch RomMon

Ndas web-interface mounting partitions without user input

comment:43 Geändert vor 4 Jahren durch RomMon

Hi Gene,

I found that the variable FTPDIR was empty at the moment of calling do_mount, so I did define it in 'ndas.cfg'. For testing I used '/var/media/ftp/ndas/', but '/var/media/ftp/' should be fine also.

Not sure if I understood your suggestion for NDAS_STOR_PREFIX < > MOD_STOR_PREFIX. I added a test if the mount prefix is not equal (already in use) before mounting.

I also changed 'ndas.cgi' to display the used mount path (in bold), so it is possible to find the full mount path via the web-interface e.g. for use in SMB, NFS or other. I attached a picture of the ndas web-interface page showing this.

See attached patch.

comment:44 Geändert vor 4 Jahren durch er13

Please use do_umount from libmodmount to umount the partitions. Could you please also check if "Restart the samba service"-setting is still necessary, to my knowledge this should be handled by mount/umount functions from libmodmount.

comment:45 Geändert vor 4 Jahren durch RomMon

Hi Gene,

I'm a bit stuck with the following after including do_mount.
I have added 'echo Start of rc.ndas' at the very beginning of rc.ndas:

#!/bin/sh

echo Start of rc.ndas

If I start ndas via the web-interface I see the following messages:

/mod/etc/init.d/rc.ndas: line 256: Ndas01: not found
/mod/etc/init.d/rc.ndas: line 256: Ndas02: not found
/mod/etc/init.d/rc.ndas: line 256: Ndas03: not found
Start of rc.ndas
NDAS driver is initialized.
'ndas-01' is registered successfully.
Block device /dev/ndas-13226201-0 is ready to use.
ftpd is updating inetd ... active.
ftpd is updating inetd ... active.
ftpd is updating inetd ... active.
Stopping Samba-smbd ... done.
Starting Samba-smbd ... done.

At the end of starting ndas via the web-interface the 3 partitions are correctly mounted.

I don’t know where the 3 ‘not found’ messages are coming from.

If I do a sh -x /mod/etc/init.d/rc.ndas start it doesn’t start with these 3 lines:

root@fritz:/var/media/ftp/uStor02/external/usr/lib/cgi-bin# sh -x /mod/etc/init.d/rc.ndas start
+ echo Start of rc.ndas
Start of rc.ndas
+ DAEMON=ndas
+ . /etc/init.d/modlibrc
+ export PATH=/mod/sbin:/mod/bin:/mod/usr/sbin:/mod/usr/bin:/mod/etc/init.d:/sbin:/bin:/usr/sbin:/usr/bin
+ export LD_LIBRARY_PATH=/mod/lib:/mod/usr/lib
:
<snip>

I do see some other similar messages for each partition, but don’t know if it is related:

<snip>
ftpd is updating inetd ... active.
+ /etc/init.d/rc.swap autostart /var/media/ftp/ndas/Ndas01
+ [ no == yes -a -x /var/media/ftp/ndas/Ndas01/autorun.sh ]
+ [ -r /mod/etc/external.pkg ]
+ /etc/init.d/rc.external start /var/media/ftp/ndas/Ndas01
+ [ -x ]
+ Ndas01
/mod/etc/init.d/rc.ndas: line 1: Ndas01: not found
:
:

comment:46 Geändert vor 4 Jahren durch RomMon

Tried to understand where these 'not found' messages are coming from.

I used logread -f in a separate shell and see that FREETZMOUNT is executed at the point of these 'not found' messages.

Jan 20 21:59:25 fritz user.notice FREETZMOUNT: Mounting device /dev/nda1 at /var/media/ftp/ndas/Ndas01 ...
Jan 20 21:59:26 fritz user.notice FREETZMOUNT: Partition Ndas01 (/dev/nda1) was mounted successfully (ntfs)

Web-interface message:/mod/etc/init.d/rc.ndas: line 256: Ndas01: not found


Jan 20 21:59:28 fritz user.notice FREETZMOUNT: Mounting device /dev/nda2 at /var/media/ftp/ndas/Ndas02 ...
Jan 20 21:59:28 fritz kern.info kernel: kjournald starting.  Commit interval 5 seconds
Jan 20 21:59:28 fritz kern.warn kernel: EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
Jan 20 21:59:28 fritz kern.info kernel: EXT3 FS on ndas-13226201-0p2, internal journal
Jan 20 21:59:28 fritz kern.info kernel: EXT3-fs: mounted filesystem with ordered data mode.
Jan 20 21:59:28 fritz user.notice FREETZMOUNT: Partition Ndas02 (/dev/nda2) was mounted successfully (ext3)

Web-interface message: /mod/etc/init.d/rc.ndas: line 256: Ndas02: not found


Jan 20 21:59:30 fritz user.notice FREETZMOUNT: Mounting device /dev/nda3 at /var/media/ftp/ndas/Ndas03 ...
Jan 20 21:59:30 fritz kern.warn kernel: EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
Jan 20 21:59:30 fritz user.notice FREETZMOUNT: Partition Ndas03 (/dev/nda3) was mounted successfully (ext2)

Web-interface message:/mod/etc/init.d/rc.ndas: line 256: Ndas03: not found

Any advice how to better troubleshoot this?

comment:47 Geändert vor 4 Jahren durch RomMon

Hi Gene,

I found that the line [ -x $TR069START ] && $TR069START $mnt_name, part of libmodmount.sh is causing these ‘/mod/etc/init.d/rc.ndas: line 256: Ndas01: not found’ messages.

Odd, because I removed as much as possible of tr069 (or is this the reason that I get these messages?):

Removal patches  --->	[*] Remove tr069
Removal patches  --->	[*]   Remove fwupdate
Removal patches  --->	[*]     Remove httpsdl (NEW)

Any suggestion how to correctly prevent these messages?

comment:48 Geändert vor 4 Jahren durch er13

Hi Ron,

just guessing, TR069START is probably not set, thus [ -x $TR069START ] && $TR069START $mnt_name expands to [ -x ] && $mnt_name (strange enough return code of [ -x ] is 0).

I'll take a look at where TR069START comes from. The proper solution is to make sure that it is set.

Best,
Gene

comment:49 Geändert vor 4 Jahren durch RomMon

I have implemented do_umount and for each partition that gets unmounted I see the following:

BusyBox v1.22.1 (2014-12-14 20:54:43 CET) multi-call binary.

Usage: mv [-fin] SOURCE DEST
or: mv [-fin] SOURCE... DIRECTORY

Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY

	-f	Don't prompt before overwriting
	-i	Interactive, prompt before overwrite
	-n	Don't overwrite an existing file

and

killall: smbd: no process killed

I do get a unmounted successfully for each partition.

Didn't look into the details yet.

comment:50 Geändert vor 4 Jahren durch er13

In 12921:

libmodmount:

  • make do_mount_locked self-contained
  • refs #2431 (in particular comment:47 of it)

comment:51 Geändert vor 3 Jahren durch RomMon

With using do_umount from libmodmount.sh the following lines are causing the Busybox mv usage message:

grep -v ":$mnt_name$" $DEVMAP > /var/dev-$$.map
mv -f /var/dev-$$.map $DEVMAP

The first line (grep) result in an empty /var/dev-<process-id>.map file.
The $DEVMAP variable is empty.
In other files (e.g. /etc/hotplug/storage) I see the line: DEVMAP=/var/tmp/mediadevmap
It is a bit unclear to me what the device map is needed for.
The Netdisk is not a USB device, and is not mentioned in /var/tmp/mediadevmap:

# cat /var/tmp/mediadevmap
/proc/bus/usb/001/002=/dev/sda1:UStor01
/proc/bus/usb/001/002=/dev/sda2:UStor02

Adding DEVMAP=/var/tmp/mediadevmap in rc.ndas solves the Busybox mv usage message.




I don't see a way to get rid of the killall: smbd: no process killed message.
Bit of an 'ugly' message between the other understandable messages.
It is caused by the line:

[ -x /etc/samba_control ] && /etc/samba_control reconfig $mnt_path

comment:52 Geändert vor 3 Jahren durch RomMon

Trying to understand why the line [ -x /etc/samba_control ] && /etc/samba_control reconfig $mnt_path is executed if the partition was already successful unmounted?

Geändert vor 3 Jahren durch RomMon

Using do_mount and do_umount from libmodmount

comment:53 Geändert vor 3 Jahren durch RomMon

Hi Gene,

I finished implementing do_mount and do_umount from libmodmount.

With do_umount it is generating killall: smbd: no process killed for each partition.
This is a message generated by the line [ -x /etc/samba_control ] && /etc/samba_control reconfig $mnt_path.
At this point the partition is already unmounted, and SMB already stopped.
Can you verify the purpose of this line?

comment:54 Geändert vor 3 Jahren durch er13

  • Verantwortlicher er13 gelöscht
Hinweis: Hilfe zur Verwendung von Tickets finden Sie in TracTickets.