Midnight Commander is gone


Recommended Posts

root@Tower:/boot/scripts -> echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/boot/scripts
root@Tower:/boot/scripts -> find /usr -name "mc" -print
/usr/libexec/mc
/usr/share/mc
/usr/bin/mc

 

Check your PATH, then do a find to see if mc is in your PATH

 

 

Link to comment

root@Tower:/boot/scripts -> echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/boot/scripts
root@Tower:/boot/scripts -> find /usr -name "mc" -print
/usr/libexec/mc
/usr/share/mc
/usr/bin/mc

 

Check your PATH, then do a find to see if mc is in your PATH

 

 

easy way to do that is to type

which mc

 

it should show it is in /usr/bin/mc

 

You probably created a file named "mc" in your current directory and it is executable, but empty, so it does nothing.

Link to comment

 

easy way to do that is to type

which mc

 

it should show it is in /usr/bin/mc

 

You probably created a file named "mc" in your current directory and it is executable, but empty, so it does nothing.

 

it says it is in /usr/bin/mc 

 

still nothing happens when I type "mc" ??? ??? ???

Link to comment

try typing /usr/bin/mc

 

 

also try ldd /usr/bin/mc

 

The second one will print some information about the binary and shared libraries.

Maybe it's running but there is a problem with a missing shared library.

 

What version of unRAID are you running?

 

/usr/bin/mc WORKED!  ;D ;D

 

ldd /usr/bin/mc gives the following output

 

        linux-gate.so.1 =>  (0xb78b6000)

        libgpm.so.1 => /lib/libgpm.so.1 (0xb78ac000)

        libslang.so.2 => /usr/lib/libslang.so.2 (0xb77d0000)

        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb77cd000)

        libdl.so.2 => /lib/libdl.so.2 (0xb77c9000)

        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb770d000)

        libc.so.6 => /lib/libc.so.6 (0xb75c1000)

        libm.so.6 => /lib/libm.so.6 (0xb759a000)

        /lib/ld-linux.so.2 (0xb78b7000)

 

I'm running 4.7 and have several apps running (SNAP, Crashplan, CouchPotato, Sabnzbd, SickBeard, Headphones).

 

What can I do to get the command to work again without typing /usr/bin?

 

 

Link to comment

try this

 

logout

login again

then type

 

 

/bin/bash

echo $PATH

whereis mc

set -x -v

hash

mc

hash

show us the output.

 

I followed the instructions and when I typed mc it opened midnight commander. Can I assume it will work on next reboot?

 

output is:

 

root@Tower:~# /bin/bash

root@Tower:~# echo $PATH

/usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin

root@Tower:~# whereis mc

mc: /usr/bin/mc /etc/mc /usr/bin/X11/mc /usr/libexec/mc /usr/share/mc

root@Tower:~# set -x -v

root@Tower:~# hash

hash

+ hash

hits    command

  1    /usr/bin/whereis

root@Tower:~# mc

mc

+ mc

 

root@Tower:~# exit

exit

 

root@Tower:~# hash

hash

+ hash

hits    command

  1    /usr/bin/whereis

  1    /usr/bin/mc

 

Link to comment

I followed the instructions and when I typed mc it opened midnight commander. Can I assume it will work on next reboot?

 

It should, we did not change anything permanently.

 

If it stops running again, do the same commands. It may lead to some synonym or shell script named as mc.

 

Should I add it to the go file or make a auto_install script?

Link to comment

I followed the instructions and when I typed mc it opened midnight commander. Can I assume it will work on next reboot?

 

It should, we did not change anything permanently.

 

If it stops running again, do the same commands. It may lead to some synonym or shell script named as mc.

 

Should I add it to the go file or make a auto_install script?

 

Not at this time. Those commands are more for interactive review to see what might have gone wrong.

For all we know there could be an out of memory condition and the process got killed.

Check your syslog.

 

Link to comment

 

Not at this time. Those commands are more for interactive review to see what might have gone wrong.

For all we know there could be an out of memory condition and the process got killed.

Check your syslog.

 

 

ok, so i logged out from terminal and logged in again and 'mc' command doesn't work. If I type '/usr/bin/mc'. It does work.

 

I then typed again:

 

/bin/bash

pwd

echo $PATH

whereis mc

set -x -v

hash

 

And I get again the 'mc' command to work. I also checked the syslog and can't see any reference to mc being killed.

 

How can I make the changes permanent?

syslog-2011-12-11.zip

Link to comment

 

next time don't run the /bin/bash command.

but do repost the output of the rest of the commands.

I'm curious of the pwd output. (something that was different then before).

 

also add in the whoami command.

 

 

output:

 

 

root@Tower:~# pwd

/root

root@Tower:~# echo $PATH

/usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin

root@Tower:~# whereis mc

mc: /usr/bin/mc /etc/mc /usr/bin/X11/mc /usr/libexec/mc /usr/share/mc

root@Tower:~# set -x -v

root@Tower:~# hash

hash

+ hash

hits    command

  1    /usr/bin/rm

  1    /usr/bin/whereis

root@Tower:~# mc

mc

+ . /usr/share/mc/bin/mc-wrapper.sh

MC_USER=`id | sed 's/[^(]*(//;s/).*//'`

id | sed 's/[^(]*(//;s/).*//'

+++ id

+++ sed 's/[^(]*(//;s/).*//'

++ MC_USER=root

MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"

++ MC_PWD_FILE=/tmp/mc-root/mc.pwd.8273

/usr/bin/mc -P "$MC_PWD_FILE" "$@"

++ /usr/bin/mc -P /tmp/mc-root/mc.pwd.8273

 

if test -r "$MC_PWD_FILE"; then

        MC_PWD="`cat "$MC_PWD_FILE"`"

        if test -n "$MC_PWD" && test -d "$MC_PWD"; then

                cd "$MC_PWD"

        fi

        unset MC_PWD

fi

++ test -r /tmp/mc-root/mc.pwd.8273

 

rm -f "$MC_PWD_FILE"

++ rm -f /tmp/mc-root/mc.pwd.8273

unset MC_PWD_FILE

++ unset MC_PWD_FILE

root@Tower:~# whoami

whoami

+ whoami

root

root@Tower:~#

 

 

I hope this means something to you  ;D

 

 

Link to comment

you need to run the hash before and after.

 

for some reason the wrapper is running and perhaps there is an argument after that's causing mc to exit.

 

ok, one more time:

 

pwd

echo $PATH

whereis mc

set -x -v

hash

mc

hash

whoami

 

 

output:

root@Tower:~# pwd

/root

root@Tower:~# echo $PATH

/usr/local/sbin:/usr/sbin:/sbin:./:/usr/local/bin:/usr/bin:/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin

root@Tower:~# whereis mc

mc: /usr/bin/mc /etc/mc /usr/bin/X11/mc /usr/libexec/mc /usr/share/mc

root@Tower:~# set -x -v

root@Tower:~# hash

hash

+ hash

hits    command

  1    /usr/bin/whereis

root@Tower:~# mc

mc

+ . /usr/share/mc/bin/mc-wrapper.sh

MC_USER=`id | sed 's/[^(]*(//;s/).*//'`

id | sed 's/[^(]*(//;s/).*//'

+++ id

+++ sed 's/[^(]*(//;s/).*//'

++ MC_USER=root

MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"

++ MC_PWD_FILE=/tmp/mc-root/mc.pwd.8522

/usr/bin/mc -P "$MC_PWD_FILE" "$@"

++ /usr/bin/mc -P /tmp/mc-root/mc.pwd.8522

 

if test -r "$MC_PWD_FILE"; then

        MC_PWD="`cat "$MC_PWD_FILE"`"

        if test -n "$MC_PWD" && test -d "$MC_PWD"; then

                cd "$MC_PWD"

        fi

        unset MC_PWD

fi

++ test -r /tmp/mc-root/mc.pwd.8522

 

rm -f "$MC_PWD_FILE"

++ rm -f /tmp/mc-root/mc.pwd.8522

unset MC_PWD_FILE

++ unset MC_PWD_FILE

root@Tower:~# hash

hash

+ hash

hits    command

  1    /usr/bin/rm

  1    /usr/bin/whereis

root@Tower:~# whoami

whoami

+ whoami

root

 

In your path you have :./: which could be part of the issue.

 

How do I do check this ???

Link to comment

login and do an ls -l

 

Is there an mc command in the /root directory?

 

 

This is what I get

 

 

root@Tower:~# ls -l

total 4

lrwxrwxrwx 1 root root  26 2011-01-12 06:17 initconfig -> /usr/local/sbin/initconfig*

-rwxr-xr-x 1 root root 171 2011-01-12 06:17 mdcmd*

lrwxrwxrwx 1 root root  25 2011-01-12 06:17 powerdown -> /usr/local/sbin/powerdown

lrwxrwxrwx 1 root root  18 2011-01-12 06:17 samba -> /etc/rc.d/rc.samba*

root@Tower:~#

 

Link to comment

Backup your config directory and reinstall unRAID. If MC works on the basic version replace your config directory and try mc again.

 

Is this the only solution? It took me a while to get unRAID to the state is today, and for a newbie, I think is quite tweaked:

 


  •  
  • I modified the myMain Disk configuration web page to add more info such as manufacturer web site or RMA number
  • I added many custom links in the 'Useful links' tab
  • Install many apps: SQL for XBMC, SNAP, Crashplan, Sab, CP, SB, and finally got them all to work  :)
  • Modify the myMain plugin main page with custom tabs and links
  • The 'go' file is a bit tweaked also
  • ... and some more I don't remember now...

 

to be honest, I'd rather live without Midnight Commander than going throuhg all that process again, especially considering it's likely I have to go through it once unRAID 5 is out.

 

Link to comment

I'm baffled, but in any case here is another try.

I have this command called lw (ls -l like where is)

 

save this command in /root/lw

do

chmod a+rx /root/lw

 

then do 

/root/lw mc

 

and see what it turns up.

 

#!/bin/sh

IFS=": "

for file in $@
do  for dir in $PATH
    do  [ -f $dir/$file ] && ls -l $dir/$file
    done
done

 

Example output:

root@atlas ~ #/root/lw mc

-rwxr-xr-x 1 root root 930056 Feb  9  2010 /usr/bin/mc

 

 

also show us the output for the alias command

type in alias

 

Link to comment

Sorry I didn't reply earlier Weebo, I really appreciate your time helping me, it's just been an hectic week at work

 

I'm baffled, but in any case here is another try.

I have this command called lw (ls -l like where is)

 

save this command in /root/lw

do

chmod a+rx /root/lw

 

I get this:

 

root@Tower:~# chmod a+rx /root/lw

chmod: cannot access `/root/lw': No such file or directory

root@Tower:~#

 

also show us the output for the alias command

type in alias

 

 

root@Tower:~# alias

alias clear='echo -e '\''\0033\0143'\'''

alias d='dir'

alias dir='/bin/ls $LS_OPTIONS --format=vertical'

alias ls='/bin/ls $LS_OPTIONS'

alias mc='. /usr/share/mc/bin/mc-wrapper.sh'

alias v='vdir'

alias vdir='/bin/ls $LS_OPTIONS --format=long'

 

 

Is the alias mc line right?

 

thanks again for your help!

 

Link to comment

Sorry I didn't reply earlier Weebo, I really appreciate your time helping me, it's just been an hectic week at work

 

I'm baffled, but in any case here is another try.

I have this command called lw (ls -l like where is)

 

save this command in /root/lw

do

chmod a+rx /root/lw

 

I get this:

 

root@Tower:~# chmod a+rx /root/lw

chmod: cannot access `/root/lw': No such file or directory

root@Tower:~#

 

also show us the output for the alias command

type in alias

 

 

root@Tower:~# alias

alias clear='echo -e '\''\0033\0143'\'''

alias d='dir'

alias dir='/bin/ls $LS_OPTIONS --format=vertical'

alias ls='/bin/ls $LS_OPTIONS'

alias mc='. /usr/share/mc/bin/mc-wrapper.sh'

alias v='vdir'

alias vdir='/bin/ls $LS_OPTIONS --format=long'

 

 

Is the alias mc line right?

 

thanks again for your help!

 

no, it is not.  It is a relative path, not an explicit one.  It will ONLY work if you are invoking it in a specific directory where the relative path is correct.

 

I think it expects that you are in the "/" directory since it references a path of "./usr/share/........."

 

You need an explicit path, not a relative one.  (and it needs to point to the correct explicit full path to mc-wrapper.sh)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.