The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

user shell error

Discussion in 'General Discussion' started by moonbaby, Jun 10, 2011.

  1. moonbaby

    moonbaby Registered

    Joined:
    Jun 10, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I changed shells for a user from bash to tcsh using this command... chsh user -s /bin/tcsh but when logging on via ssh under that user i get a "Illegal variable name" error...i type, echo $shell and it says, /bin/tcsh. I have a .cshrc file in the user /home directory but shell doesn't seem to read that. I am curious what that Illegal variable name could be.

    I'm using CentOS release 5.6...WHM 11.30.0 (build 29)

    Here's what i get from the ssh login screen...using PuTTY.

    user@xxx.xxx.xxx.xxx's password:
    Last login: Wed Jun 08 14:37:11 2011 from xxx.xx.xx.xxx
    Illegal variable name.
    [user@server1 ~]$

    The /etc/passwd file has this...

    user:x:502:501::/home/user:/bin/tcsh

    I never had this problem before up until a few weeks ago when cpanel/whm updated with newest version.

    Any ideas on correcting this error? Thanks!
     
    #1 moonbaby, Jun 10, 2011
    Last edited: Jun 10, 2011
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Does the problem go away if you move /etc/profile.d/localib.csh out of that directory?
     
  3. moonbaby

    moonbaby Registered

    Joined:
    Jun 10, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Yes, that solved the issue. Do i need the localib.csh for anything? I edited the file like this and it solved the error...thank you very much.

    #cPanel Added local::lib -- BEGIN
    #setenv LOCALLIBUSER $USER
    #if ( -e /usr/bin/whoami ) then
    # setenv LOCALLIBUSER `whoami`
    #endif
    #if ( "$LOCALLIBUSER" != "root" ) then
    # eval $(perl -Mlocal::lib)
    #endif
    #cPanel Added local::lib -- END
     
  4. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Kenneth, I just upgraded to 11.30 Stable, and I am seeing this same problem with one user that prefers tcsh

    I could try the suggestion you have, to move locallib.csh out of the way, but can you explain the issue better? The original poster asked you if this file is needed, but there wasn't any reply... of course, I have the same question... if removing it will cause any other issues?

    Thanks!

    - Scott
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Scott (and others),

    /etc/profile.d/localib.csh is only useful for users that are doing application development in perl. The login script uses the local::lib perl Module to add ~/perl automatically to the include path of scripts and applications started by the user. We provide a similar login script for bash users.

    Removing the locallib.csh file from the profile.d directory means that functionality is no longer available to shell users. If you have no shell users, no shell users that use their own perl applications, or no shell users that develop their own perl applications then removal of the login script should be OK.

    I believe we have an open bug on that script, but am not aware of the id off-hand.
     
  6. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Hi Kenneth. Thanks for the additional information. Would you be so kind as to confirm that there is an open bug report on this? I'd like to track it. I'm going to make the suggested work-around for one server, but would prefer to put it back the way it was, after the bug is squashed.

    Thanks!

    - Scott
     
  7. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    P.S. There is a small typo in Kenneth's fix... it's /etc/profile.d/locallib.csh (not localib.csh) -- for anyone like me that tries to cut/paste, you'll need to know this. :)
     
  8. lewayotte

    lewayotte Member

    Joined:
    Nov 17, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm one of those people who prefer tcsh, and finally got around to looking into this problem. I fixed it with this little hack:

    I changed this line:
    Code:
    eval $(perl -Mlocal::lib)
    
    To look like this line:
    Code:
    eval `perl -Mlocal::lib | awk '{ sub( /setenv/, "; setenv" ); print }'`
    
    So my locallib.csh looks like this:
    Code:
    cpanel# cat locallib.csh
    #cPanel Added local::lib -- BEGIN
    setenv LOCALLIBUSER $USER
    if ( -e /usr/bin/whoami ) then
            setenv LOCALLIBUSER `whoami`
    endif
    if ( "$LOCALLIBUSER" != "root" ) then
        eval `perl -Mlocal::lib | awk '{ sub( /setenv/, "; setenv" ); print }'`
    endif
    #cPanel Added local::lib -- END
    
     
  9. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    On a new CentOS box, our customer that prefers tcsh is getting this error when logging in via SSH:

    limit: coredumpsize: Can't set limit

    If I edit /etc/profile.d/limits.csh and comment out the line for non-root users regarding coredumpsize:

    # limit coredumpsize 200000

    Then, of course, the error goes away. But is this the right fix? Other options?

    - Scott
     
Loading...

Share This Page