SynoCommunity - SynoCLI Filetools - mc not working?

Currently reading
SynoCommunity - SynoCLI Filetools - mc not working?

11
3
NAS
DS3617xs
Operating system
  1. macOS
Mobile operating system
  1. iOS
In search of a few useful utilities missing on my NAS such as Nano and Midnighgt Commander, I stumbled across SynoCommunity.

There I found SynoCLI Filetools, including among others, Nano and MC.

All utilities work - apart from mc. It's simply not recognized as a command.

Anyone have this working?
 
It seems like something is wrong with the installer ( /var/packages/synocli-file/scripts/installer). The commands to create the symlinks are located in the file /var/packages/synocli-file/scripts/service-setup, which is sourced in installer, the service_postinst() function from service-setup is called in installer's postinst() function... which is called by nothing?! Not sure though if the package management itself sources the installer file and calls the functions from somewhere else. At least it is safe to say: something didn't work right.

You can either create your own symlinks or call mc with it's absolute path ( /var/packages/synocli-file/target/bin/mc )... who the hell uses mc anyways?!

You might want to check sudo synogear list on the shell. It provides many binaries that are missing on the ds. I installed it because of tmux, lsof and the replacement for top:)
 
11
3
NAS
DS3617xs
Operating system
  1. macOS
Mobile operating system
  1. iOS
Thanks - this is the second time in two days that you have aided me - I will need to buy you a beer or coffee or somehow express my gratitude not just in words :)

LOL @ Midnight Commander - well, maybe I'm a dinosaur but I come from unRAID and it has proven invaluable to me in that environment many times :)

I will definitely check out synogear,
 
11
3
NAS
DS3617xs
Operating system
  1. macOS
Mobile operating system
  1. iOS
Follow-up question: Where would I need to place the symlink for mc to be available when in CLI? usr/bin or usr/local/bin - what is best practice?
 
Last edited:
Btw I discoverd what caused the missing symlink for mc. In the service-setup function sercice_postinst() the symlinks for mc are only created, if the file mc-utf8 exist, which it didn't.

I modified /var/packages/synocli-file/scripts/start-stop-status to look like this:
Code:
#!/bin/sh
SYNOPKG_PKGDEST=$(readlink /var/packages/synocli-file/target)
# fix missing file mc-utf8
if [ ! -e ${SYNOPKG_PKGDEST}/bin/mc-utf8 ];then
  pushd ${SYNOPKG_PKGDEST}/bin
  ln -s mc mc-utf8
  popd
fi
. $(dirname $0)/service-setup

case $1 in
    start)
        service_postinst
        exit 0
        ;;
    stop)
        service_postuninst
        exit 0
        ;;
    status)
        exit 0
        ;;
    log)
        exit 1
        ;;
    *)
        exit 1
        ;;
esac

and then executed it with: bash start-stop-status start. From now on the symlinks will be created whenever the package is started and deleted when the package stops. This is the behavior most other packes have as well.
 
11
3
NAS
DS3617xs
Operating system
  1. macOS
Mobile operating system
  1. iOS
Awesome! Works like a charm! Thank you so much :)
 
11
3
NAS
DS3617xs
Operating system
  1. macOS
Mobile operating system
  1. iOS
Btw I discoverd what caused the missing symlink for mc. In the service-setup function sercice_postinst() the symlinks for mc are only created, if the file mc-utf8 exist, which it didn't.

I modified /var/packages/synocli-file/scripts/start-stop-status to look like this:
Code:
#!/bin/sh
SYNOPKG_PKGDEST=$(readlink /var/packages/synocli-file/target)
# fix missing file mc-utf8
if [ ! -e ${SYNOPKG_PKGDEST}/bin/mc-utf8 ];then
  pushd ${SYNOPKG_PKGDEST}/bin
  ln -s mc mc-utf8
  popd
fi
. $(dirname $0)/service-setup

case $1 in
    start)
        service_postinst
        exit 0
        ;;
    stop)
        service_postuninst
        exit 0
        ;;
    status)
        exit 0
        ;;
    log)
        exit 1
        ;;
    *)
        exit 1
        ;;
esac

and then executed it with: bash start-stop-status start. From now on the symlinks will be created whenever the package is started and deleted when the package stops. This is the behavior most other packes have as well.

Do you mind if I log this as an issue and suggest your remedy, for the package on github? Will of course credit you!
I just think others might benefit so it should be logged.
 
feel free! Though, the service_postinst() function was called during the package installation, BUT due to the missing symlink mc-utf8, the symlink creation was skipped. This would make my fix obsolete.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Similar threads

Similar threads

Trending threads

Top