Find the answer to your Linux question:
Results 1 to 2 of 2
Hi! Im having some strange behavior when running the "hwclock" command with SSH in my Slackware Server: Code: # date && hwclock && ssh root@127.0.0.1 /sbin/hwclock Wed Mar 2 16:28:45 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    6

    Slackware, SSH & HWClock


    Hi!

    Im having some strange behavior when running the "hwclock" command with SSH in my Slackware Server:
    Code:
    # date && hwclock && ssh root@127.0.0.1 /sbin/hwclock
    Wed Mar  2 16:28:45 ART 2011
    Wed 02 Mar 2011 04:29:00 PM ART  -0.753012 seconds
    root@127.0.0.1's password:
    Wed Mar  2 16:29:02 2011  -0.979627 seconds
    As you can see, the Output from running "hwclock" and "ssh root@127.0.0.1 /sbin/hwclock" is different; cause one of them shows me the information in different order and in fact i doesnt even show me the TimeZone.

    Slackware Details:
    Code:
    Slackware 13.0.0.0.0
    OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009
    hwclock from util-linux-ng 2.14.2
    Linux 2.6.32.2
    I've tried the same in a RedHat and all worked out just fine.
    Red Hat Details:
    Code:
    Red Hat Enterprise Linux Server release 5.4 (Tikanga)
    OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
    hwclock from util-linux-2.13-pre7
    Linux Edocta_ARG 2.6.18-164.el5

    I've run some more tests with more strange results...

    Code:
    # ssh root@127.0.0.1 echo && /sbin/hwclock
    root@127.0.0.1's password:
    
    Thu 03 Mar 2011 07:34:24 AM ART  -0.601686 seconds
    The Output seems OK, and the only difference was to first run command "echo" with no parameters before "hwclock".


    In the Slackware server, i've run the command through SSH against the RedHat Server:
    Code:
    # ssh root@MyRedHatServer /sbin/hwclock
    root@MyRedHatServer's password:
    Thu 03 Mar 2011 07:37:30 AM ART  -0.709783 seconds
    The Output seems OK.


    Using a recently created User (MyNewUser) in both servers... In the Slackware server, i've run the command through SSH against the RedHat Server:
    Code:
    # ssh MyNewUser@MyRedHatServer /sbin/hwclock
    MyNewUser@MyRedHatServer's password:
    Thu Mar  3 07:41:07 2011  -0.821204 seconds
    The Output is Strange.


    In the RedHat server, i've run the command through SSH against the Slackware Server:
    Code:
    # ssh root@MySlackwareServer /sbin/hwclock
    root@MySlackwareServer's password:
    Thu Mar  3 07:39:13 2011  -0.072013 seconds
    Strange Output again.


    Using the recently created User (MyNewUser) in both servers... In the RedHat server, i've run the command through SSH against the Slackware Server:
    Code:
    # ssh MyNewUser@MySlackwareServer /sbin/hwclock
    MyNewUser@MySlackwareServer's password:
    Thu Mar  3 07:44:56 2011  -0.053655 seconds
    One more... the Output is Strange.


    The Environment Variables in the Slackware Server:
    Code:
    # env
    CPLUS_INCLUDE_PATH=/usr/lib/qt/include
    MANPATH=/usr/local/man:/usr/man:/usr/lib/java/man:/usr/share/texmf/man
    HOSTNAME=MySlackwareHOSTNAME
    TERM=xterm
    SHELL=/bin/bash
    SSH_CLIENT=MyPCIP 1630 22
    SSH_TTY=/dev/pts/4
    USER=root
    LD_LIBRARY_PATH=/usr/local/lib
    LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.bat=01;32:*.BAT=01;32:*.btm=01;32:*.BTM=01;32:*.cmd=01;32:*.CMD=01;32:*.com=01;32:*.COM=01;32:*.dll=01;32:*.DLL=01;32:*.exe=01;32:*.EXE=01;32:*.7z=01;31:*.ace=01;31:*.arj=01;31:*.bz2=01;31:*.cpio=01;31:*.deb=01;31:*.dz=01;31:*.gz=01;31:*.jar=01;31:*.lzh=01;31:*.lzma=01;31:*.rar=01;31:*.RAR=01;31:*.rpm=01;31:*.rz=01;31:*.tar=01;31:*.taz=01;31:*.tb2=01;31:*.tbz2=01;31:*.tbz=01;31:*.tgz=01;31:*.tlz=01;31:*.trz=01;31:*.txz=01;31:*.tz=01;31:*.tz2=01;31:*.xz=01;31:*.z=01;31:*.Z=01;31:*.zip=01;31:*.ZIP=01;31:*.zoo=01;31:*.aac=00;35:*.anx=01;35:*.asf=01;35:*.ASF=01;35:*.au=00;35:*.axa=00;35:*.axv=01;35:*.avi=01;35:*.AVI=01;35:*.bmp=01;35:*.BMP=01;35:*.flac=01;35:*.FLAC=01;35:*.gif=01;35:*.GIF=01;35:*.jpg=01;35:*.JPG=01;35:*.jpeg=01;35:*.JPEG=01;35:*.m2a=01;35:*.M2A=01;35:*.m2v=01;35:*.M2V=01;35:*.m4a=01;35:*.M4A=01;35:*.m4p=01;35:*.M4P=01;35:*.m4v=01;35:*.M4V=01;35:*.mid=00;35:*.midi=00;35:*.mka=00;35:*.mov=01;35:*.MOV=01;35:*.mp3=01;35:*.MP3=01;35:*.mp4=01;35:*.mp4v=01;35:*.mpc=01;35:*.MPC=01;35:*.mpeg=01;35:*.MPEG=01;35:*.mpg=01;35:*.MPG=01;35:*.nuv=01;35:*.oga=00;35:*.ogv=01;35:*.ogx=01;35:*.ogg=01;35:*.OGG=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.PNG=01;35:*.ppm=01;35:*.qt=01;35:*.ra=00;35:*.ram=01;35:*.RAM=01;35:*.rm=01;35:*.RM=01;35:*.spx=00;35:*.svg=01;35:*.svgz=01;35:*.tga=01;35:*.TGA=01;35:*.tif=01;35:*.TIF=01;35:*.tiff=01;35:*.TIFF=01;35:*.vob=01;35:*.wav=01;35:*.WAV=01;35:*.wma=01;35:*.WMA=01;35:*.wmv=01;35:*.WMV=01;35:*.xbm=01;35:*.xcf=01;35:*.xpm=01;35:*.xspf=00;35:*.xwd=01;35:*.XWD=01;35:
    GDK_USE_XFT=1
    T1LIB_CONFIG=/usr/share/t1lib/t1lib.config
    XDG_CONFIG_DIRS=/etc/xdg:/etc/kde/xdg:/etc/xfce/xdg
    MINICOM=-c on
    MAIL=/var/mail/root
    PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin
    LC_COLLATE=C
    INPUTRC=/etc/inputrc
    PWD=/root
    JAVA_HOME=/usr/lib/java
    LANG=en_US
    QT4DIR=/usr/lib/qt
    KDEDIRS=/usr
    PS1=\u@\h:\w\$
    PS2=>
    SHLVL=1
    HOME=/root
    ODBCINI=/usr/local/etc
    LS_OPTIONS= -F -b -T 0 --color=auto
    LESS=-M
    LOGNAME=root
    ODBCHOME=/usr/local/
    SSH_CONNECTION=MyPCIP 1630 MySlackwareServerIP 22
    PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
    LESSOPEN=|lesspipe.sh %s
    G_BROKEN_FILENAMES=1
    _=/usr/bin/env

    Any ideas what could be the problem?

    Thanks in advance.

    PD: Sorry for my poor English.
    Last edited by BiFo; 03-03-2011 at 09:49 AM.

  2. #2
    Just Joined!
    Join Date
    Aug 2010
    Posts
    6
    Hi!
    Well, someone help me to solve my issue.
    With the following commands i'll get the Output i want:
    Code:
    # ssh root@127.0.0.1 bash -l -c /sbin/hwclock
    # ssh root@127.0.0.1 LANG=en_US /sbin/hwclock
    Bye!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •