Kaseya Community

Linux Agent Install Fatal Error with KcsSetup.sh

This question is not answered

So I've uploaded KcsSetup.sh to a *nix box, used chmod +x to make it executable, made sure it was in /root, and tried executing it. I get the following error:

Fatal: Cannot extract installation options from KcsSetup.sh.

I try it again running KcsSetup.sh -x and am presented with the following information:

+ KCS_SETUP_ENCODED=/tmp/KcsSetup26611.base64

++ basename ./KcsSetup.sh

+ KCS_BASENAME=KcsSetup.sh

+ KCS_SETUP=/tmp/KcsSetup.sh26611

+ KAGENT_INSTALL_LOG=/tmp/KASetup_26611.log

+ KCS_VERSION_FILE=/tmp/KASetup_26611.version

+ trap cleanup EXIT

+ varLogCreate

++ date '+%Y/%m/%d %H:%M:%S'

+ local 'date=2012/04/27 15:19:31'

+ syslog 'Start time: 2012/04/27 15:19:31'

+ '[' '' == true ']'

+ checkTempDir /tmp

+ local tmpdir=/tmp

+ '[' /tmp '!=' /tmp -a '!' -d /tmp ']'

++ getMountPoint /tmp

++ local cur=/

+++ dirname /tmp

++ local dir=/

++ mount

++ read topoint on mountpoint tlabel type options extra

++ echo EOF

++ '[' /dev/sda1 == EOF ']'

++ '[' / == / ']'

++ echo /

++ return

+ local mountpoint=/

++ getMountOptions /

++ local mpoint=/

++ mount

++ read topoint on mountpoint tlabel type options extra

++ '[' / == / ']'

++ echo '(rw)'

++ return

+ local 'mountopts=(rw)'

+ grep -w -q noexec

+ echo '(rw)'

++ getInstallerPath

++ local p=

++ '[' '' == / ']'

+++ dirname /root/

++ command cd /

++ cd /

+++ basename

basename: too few arguments

Try `basename --help' for more information.

++ echo //

+ ThisFile=//

+ '[' -z // -o '!' -r // ']'

++ type -p tail

+ Tail=/usr/bin/tail

+ '[' -z /usr/bin/tail ']'

++ type -p head

+ Head=/usr/bin/head

+ '[' -z /usr/bin/tail ']'

++ tail -n 5 //

tail: //: Is a directory

++ head -n 1

+ KArgs=

+ '[' -z '' ']'

+ varLogWrite F 'Cannot extract installation options from KcsSetup.sh.'

+ local mtype=F

+ local prefix

+ local debug=

+ local out=

+ local saveVerbose=

+ '[' false == false -a '(' F == F -o F == W ')' ']'

+ out=true

+ Verbose=

+ prefix=Fatal:

+ shift

+ '[' -n 'Cannot extract installation options from KcsSetup.sh.' ']'

+ '[' -n true ']'

+ printf '%-15s %s\n' Fatal: 'Cannot extract installation options from KcsSetup.sh.'

Fatal: Cannot extract installation options from KcsSetup.sh.

+ syslog 'Fatal: Cannot extract installation options from KcsSetup.sh.'

+ '[' '' == true ']'

+ shift

+ prefix=

+ '[' -n '' ']'

+ Verbose=

+ exit

+ cleanup

+ local rc=0

+ trap '' EXIT

+ '[' true == true ']'

+ rm -f /tmp/KcsSetup26611.base64 /tmp/KcsSetup.sh26611 /tmp/KASetup_26611.version

+ '[' -n '' ']'

+ exit 0

So, to me, it looks like for some reason its bombing out when its trying to do the basename steps. Its not finding something and is getting "//" returned so when it tries to use tail it blows up. My question is, does anyone know how that part of the .sh works and what it is even looking for?

I'm not expecting help as this is not a supported Linux distro. Point in fact, its a Linux based router and is quite possibly heavily customized. I will be reaching out to the developer, but I forsee questions on what this thing is doing or needs. I imagine some few of us here have at least tried to get this to go on a non-standard Linux distro. Any forsight from you gurus would be appreciated. I deal with Windows too much and *nix not enough to be 100% sure what I'm looking at.

Sorry about the format... but the HTML seems a bit wonky and likes to add spaces I don't want. Something is wrong with the code tags...

All Replies
  • The problem is that the getInstallerPath shell function fails to return the installer path (because you're shell doesn't correctly supply ${BASH_SOURCE[0]}"). You can get around this problem by making getInstallerPath return the correct path (something like echo "/root/KcsSetup.sh").

    However, once past this hurdle there is no guarantee you'll be able to install. However, if you're router has the correct dynamic libraries you may be able to install and run. The main task of the shell portion of the installer is to install missing packages. Usually these are 32-bit runtime libraries needed to run 32-bit applications on a 64-bit system. If your router has all required libraries, then it should install and the agent should run. If not, unless there is a way of adding libraries to your router you're out of luck.

    Gordon - Linux agent development team