Can't install SMB V2 on NSA325v2

Options

Hello everyone,

i tried to update samba on my Zyxel NSA325v2 according to this HOW TO https://zyxel.diskstation.eu/forum/viewtopic.php?t=24&sid=3e40a8ef0b230af1ad6c9d0802170f46

It fails at the Point where i start /opt/etc/init.d/S09ZyXELSambaReplacement.

An error accured: mw: can`t rename '/opt/var/lock/*': No such file or directory

Can anyone help me?

Best Regards

All Replies

  • Mijzelf
    Mijzelf Posts: 2,607  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options

    That is caused by next lines in the start script:

        # Move /opt/var/lock to ramdrive, else the maintenance of browse.dat will keep the disk awake
    if [ ! -h /opt/var/lock ]
    then
    mv /opt/var/lock/* /var/lock/
    rmdir /opt/var/lock && ln -s /var/lock /opt/var/lock
    fi

    Apparently you don't have an /opt/var/lock directory, so you can just create the symlink

    ln -s /var/lock /opt/var/lock
    

  • derboum
    derboum Posts: 5
    First Comment
    Options

    Thank you for the quick answer.

    Unfortunetly after i did the command

    ln -s /var/lock /opt/var/lock
    
    

    and then tried to start

    /opt/etc/init.d/S09ZyXELSambaReplacement start
    

    nothing happens.

    What can i do?

  • Mijzelf
    Mijzelf Posts: 2,607  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options

    Try restart instead of start. Or reboot the box.

  • derboum
    derboum Posts: 5
    First Comment
    Options

    Tried both. Nothing happens.

    Anything else i can do?

  • Mijzelf
    Mijzelf Posts: 2,607  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options

    Use the 'debug mode' of the startscript:

    /bin/sh -x /opt/etc/init.d/S09ZyXELSambaReplacement start
    

  • derboum
    derboum Posts: 5
    First Comment
    edited May 2023
    Options

    Is this good or bad?

    I tried to check smbstatus but it throws an error.

  • derboum
    derboum Posts: 5
    First Comment
    Options

    ~ # /bin/sh -x /opt/etc/init.d/S09ZyXELSambaReplacement start

    • prgmname1=/opt/sbin/nmbd
    • prgmname2=/opt/sbin/smbd
    • configfile=/opt/etc/samba/ZyXELSambaReplacement.conf
    • nmbdpid=/opt/var/run/nmbd-ZyXELSambaReplacement.conf.pid
    • smbdpid=/opt/var/run/smbd-ZyXELSambaReplacement.conf.pid
    • basename /opt/etc/init.d/S09ZyXELSambaReplacement
    • [ S09ZyXELSambaReplacement = samba.sh ]
    • startreplacement
    • [ -f /etc/init.d/samba.replaced.sh ]
    • return
    • exit

    this is the output.

  • Mijzelf
    Mijzelf Posts: 2,607  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options

    [ -f /etc/init.d/samba.replaced.sh ]

    return

    Are you sure that it isn't automatically started on boot? The start procedure is roughly

    • Stop stock firmware (/etc/init.d/samba.sh stop)
    • Rename firmware startscript to /etc/init.d/samba.replaced.sh
    • Create a symlink /etc/init.d/samba.sh to /opt/etc/init.d/S09ZyXELSambaReplacement
    • Start the Entware samba via this symlink (/etc/init.d/samba.sh start)

    The symlink is created because the firmware uses it to restart samba when needed. This way the firmware restarts the Entware samba without knowing (or needing to know)

    Stopping of the replacement is the same sequence reversed.

    The script checks if the renamed startscript is available, and if so, then exits, which seems to be the case.

Consumer Product Help Center