Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: Smitro on November 25, 2006, 10:29:09 AM

Title: Basic Commands not working
Post by: Smitro on November 25, 2006, 10:29:09 AM
I'm having a problem with simple commands:

Before alot of commands I've now found I have to type:
/sbin/e-smith/

for example:
/sbin/e-smith/config ... or /sbin/e-smith/db ...

I'm not sure what caused it. I was told that it would fix it's self if I did a
/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot

This happened a while ago and I got busy with other things and never got back to it. The origional post for my problem was here, but I thought I better start a new post as I think my problem is a little different to how it started out.
http://forums.contribs.org/index.php?topic=33964.0

I'm not sure if the contrib mentioned cause this as the problem was noticed after a day of installing different contribs after a fresh build.

Could this be as simple as just adding a line backing into a file somewhere?
Title: Basic Commands not working
Post by: william_syd on November 25, 2006, 11:28:45 AM
What does printenv  and set give you?
Title: Basic Commands not working
Post by: Smitro on November 25, 2006, 02:22:50 PM
Hope this helps

Printenv:
Code: [Select]

HOSTNAME=box1
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
SSH_CLIENT=192.168.1.100 2106 22
PERL5LIB=/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.5
SSH_TTY=/dev/pts/0
USER=smitro
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
MAIL=/var/spool/mail/smitro
PWD=/home/e-smith/files/users/smitro
INPUTRC=/etc/inputrc
LANG=en_US
HOME=/root
SHLVL=2
LOGNAME=smitro
SSH_CONNECTION=192.168.1.100 2106 192.168.1.254 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/usr/bin/printenv


Set:
Code: [Select]

BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="00" [2]="15" [3]="1" [4]="release" [5]="i686-redhat-linux-gnu")
BASH_VERSION='3.00.15(1)-release'
COLORS=/etc/DIR_COLORS.xterm
COLUMNS=80
DIRSTACK=()
EUID=0
GROUPS=()
G_BROKEN_FILENAMES=1
HISTFILE=/root/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/root
HOSTNAME=box1
HOSTTYPE=i686
IFS=$' \t\n'
INPUTRC=/etc/inputrc
LANG=en_US
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=24
LOGNAME=smitro
LS_COLORS='no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:'
MACHTYPE=i686-redhat-linux-gnu
MAIL=/var/spool/mail/smitro
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
PERL5LIB=/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.5
PIPESTATUS=([0]="0")
PPID=15829
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
PWD=/home/e-smith/files/users/smitro
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=2
SSH_CLIENT='192.168.1.100 2106 22'
SSH_CONNECTION='192.168.1.100 2106 192.168.1.254 22'
SSH_TTY=/dev/pts/0
SUPPORTED=en_US:en
TERM=xterm
UID=0
USER=smitro
_=clear
_esmith_config ()
{
    cmd=$(echo $1 | sed -e 's/config$/db/');
    COMP_WORDS=($cmd ${COMP_WORDS[*]});
    COMP_WORDS[1]=configuration;
    COMP_CWORD=$[ $COMP_CWORD + 1 ];
    _esmith_db $*;
    return $?
}
_esmith_db ()
{
    if [ ! $(which $1 2>/dev/null) ]; then
        return 0;
    fi;
    local cur;
    cur=${COMP_WORDS[$COMP_CWORD]};
    case $COMP_CWORD in
        1)
            COMPREPLY=($(find /home/e-smith /home/e-smith/db -maxdepth 1 -type f                        \( -name '.*' -prune -o                            -name "$cur*" -printf "%f\n" \)))
        ;;
        2)
            COMPREPLY=($(/sbin/e-smith/db 2>&1 |awk '{print $3}'               |grep "^$cur" ))
        ;;
        3)
            local file;
            file=${COMP_WORDS[1]};
            local cmd;
            cmd=${COMP_WORDS[2]};
            local haskey;
            haskey=$(/sbin/e-smith/db 2>&1 | grep "dbfile $cmd" | awk '{print $4}');
            if [ -n "$haskey" ]; then
                COMPREPLY=($(/sbin/e-smith/db $file keys |grep "^$cur"));
            fi
        ;;
        *)
            local file;
            file=${COMP_WORDS[1]};
            local cmd;
            cmd=${COMP_WORDS[2]};
            local key;
            key=${COMP_WORDS[3]};
            local i;
            i=$COMP_CWORD;
            local prev;
            local valtype;
            while [ "$valtype" == "..." ] || [ "$valtype" == "" ]; do
                prev=${COMP_WORDS[$[i-1]]};
                PAT='$3';
                for j in $(seq 4 $[i+1]);
                do
                    PAT="$PAT,\$$j";
                done;
                valtype=$(/sbin/e-smith/db 2>&1 | awk "{print $PAT}"            | grep "^$cmd" | awk "{print \$$[i-1]}");
                i=$[i-2];
            done;
            case $(echo "$valtype" |sed -e 's/[][0-9]//g') in
                "type")
                    COMPREPLY=($(/sbin/e-smith/db $file gettype $key           | grep "^$cur"))
                ;;
                "prop")
                    COMPREPLY=($(/sbin/e-smith/db $file printprop $key         | sed -e 's/=.*//' | grep "^$cur"))
                ;;
                "val")
                    COMPREPLY=($(/sbin/e-smith/db $file getprop $key $prev     | grep "^$cur"))
                ;;
                *)

                ;;
            esac
        ;;
    esac;
    return 0
}
_esmith_expand-template ()
{
    if [ ! $(which $1 2>/dev/null) ]; then
        return 0;
    fi;
    local cur;
    cur=${COMP_WORDS[$COMP_CWORD]};
    case $COMP_CWORD in
        1)
            COMPREPLY=($(find /etc/e-smith/templates                           /etc/e-smith/templates-custom                      -regex "/etc/e-smith/templates\(-custom\)?$cur.*"                       -printf "[ -f /%P ] && echo /%P\n"                     | sh | uniq))
        ;;
        *)

        ;;
    esac;
    return 0
}
_esmith_signal-event ()
{
    if [ ! $(which $1 2>/dev/null) ]; then
        return 0;
    fi;
    local cur;
    cur=${COMP_WORDS[$COMP_CWORD]};
    case $COMP_CWORD in
        1)
            COMPREPLY=($(find /etc/e-smith/events/ -maxdepth 1 -type d               \( -name 'actions' -prune -o                        -name "$cur*" -printf "%f\n" \)))
        ;;
        *)

        ;;
    esac;
    return 0
}
Title: Basic Commands not working
Post by: william_syd on November 25, 2006, 02:27:06 PM
Your not logged in as root.

Did you try the commands without /sbin/e-smith when logged in as root ?

Compare my PATH to yours..

As root
Code: [Select]
HOSTNAME=tiger
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=192.168.1.250 2955 22
PERL5LIB=/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.5
SSH_TTY=/dev/pts/0
USER=root
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
MAIL=/var/spool/mail/root
PATH=/sbin/e-smith:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
INPUTRC=/etc/inputrc
PWD=/var/lib/vmware/Virtual Machines
LANG=en_US
SHLVL=1
HOME=/root
LOGNAME=root
SSH_CONNECTION=192.168.1.250 2955 192.168.2.9 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/usr/bin/printenv
OLDPWD=/var/lib/vmware


As a user with a real shell
Code: [Select]
HOSTNAME=tiger
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=192.168.1.250 3232 22
PERL5LIB=/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.5
SSH_TTY=/dev/pts/0
USER=william
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
MAIL=/var/spool/mail/william
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
INPUTRC=/etc/inputrc
PWD=/home/e-smith/files/users/william
LANG=en_US
SHLVL=1
HOME=/home/e-smith/files/users/william
LOGNAME=william
SSH_CONNECTION=192.168.1.250 3232 192.168.2.9 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/usr/bin/printenv
Title: Re: Basic Commands not working
Post by: CharlieBrady on November 25, 2006, 04:20:03 PM
Quote from: "Smitro"
I'm having a problem with simple commands:

Before alot of commands I've now found I have to type:
/sbin/e-smith/


That almost certainly means that you are not logged in as root, and therefore don't have /sbin/e-smith in your PATH variable. If you've been using su, use "su -".
Title: Basic Commands not working
Post by: Smitro on November 26, 2006, 01:42:14 PM
Thanks CharlieBrady, you hit the nail on the head!

I was using the su command, I'd never heard of the su - command. it's all working now. :D