- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: su and SHELL environment variable
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 12:42 AM
08-11-2004 12:42 AM
su and SHELL environment variable
I observe a difference between HP-UX 11.00 and
11.11 with the settings of the SHELL environment
variable when doing a su - user.
Basically on 11.00 SHELL is set to the login
shell of the new user while on 11.11 the value
seems to be always /sbin/sh. The 11.00 behaviour is the one I would expect according
to the man pages of su and login.
To illustrate:
# uname -r
B.11.00
# useradd -s /bin/csh testusr
# printenv SHELL
/sbin/sh
# su - testusr -c 'printenv SHELL'
(c)Copyright 1983-1997 Hewlett-Packard Co.,
/bin/csh
# uname -r
B.11.11
# useradd -s /bin/csh testusr
# printenv SHELL
/sbin/sh
# su - testusr -c 'printenv SHELL' 2>/dev/null
(c)Copyright 1983-2000 Hewlett-Packard Co.,
/sbin/sh
Has anyone a idea why this happens? This is
quite annoying for csh users since the
usual construct of "eval `tset -s -Q`"
in .login files will not work any longer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 12:58 AM
08-11-2004 12:58 AM
Re: su and SHELL environment variable
Are you shure that "csh" shell is placed into /bin directory in both systems?
Pls check this in both systems with:
#whence csh
The try again using the dsiplayed path. In my case "csh" shell is placed into /usr/bin/ in both systems.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 01:05 AM
08-11-2004 01:05 AM
Re: su and SHELL environment variable
What is contained in /etc/shells on each of these systems?
Is it possible that /usr/bin/csh is *not* in the file on the 11.11 system?
If it exists then the getusershell() sys call leaves the file open & will step through the entries on subsequent calls.
man 3c getusershell
for details.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 01:53 AM
08-11-2004 01:53 AM
Re: su and SHELL environment variable
here is the content of /etc/shells:
11.11
# grep -v \# /etc/shells
/sbin/sh
/usr/bin/csh
/usr/bin/sh
/usr/bin/rsh
/usr/bin/ksh
/usr/bin/rksh
/usr/bin/keysh
/bin/csh
/bin/sh
/bin/ksh
/usr/bin/false
/bin/ftp_only
11.0
# grep -v \# /etc/shells
/sbin/sh
/sbin/sh
/usr/bin/sh
/usr/bin/rsh
/usr/bin/ksh
/bin/csh
/usr/local/bin/tcsh
/usr/bin/tcsh
/bin/csh is present on both systems.
/etc/csh.login is identical except for some
revision information.
Thanks and br
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 01:58 AM
08-11-2004 01:58 AM
Re: su and SHELL environment variable
When you use login(1) the SHELL variable is set correctly.
I recommend to open a call with HP to address this.
Carsten
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 02:00 AM
08-11-2004 02:00 AM
Re: su and SHELL environment variable
# ll /bin/csh
on both systems ?
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 02:04 AM
08-11-2004 02:04 AM
Re: su and SHELL environment variable
here is the ls -l output:
# uname -r
B.11.00
# ls -l /bin/csh
-r-xr-xr-x 1 bin bin 163840 Jan 24 2002 /bin/csh
# uname -r
B.11.11
# ls -l /bin/csh
-r-xr-xr-x 1 bin bin 155648 Sep 20 2002 /bin/csh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2004 06:11 AM
08-11-2004 06:11 AM
Re: su and SHELL environment variable
ll /bin
lr-xr-xr-t 1 root sys 8 Nov 5 2003 /bin@ -> /usr/bin
Same for /lib. Try creating the user with /usr/bin/csh. And while Linux is still languishing in the past with the older filesystem layout, it's worth using the new pathnames whenever possible. Transition links are the default right now, but HP may make these optional in a furture release.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2004 04:24 AM
08-17-2004 04:24 AM
Re: su and SHELL environment variable
as it turned out the problem is not related
to a difference between 11.0 and 11.11. I
tested it on another 11.11 machine and the
behaviour was ok. Seems to be a missing patch
on the machine I tested first. Since this
environment is no longer available to me
I cannot investigate it any further.
Thanks for all the replies.
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2005 05:00 AM
01-11-2005 05:00 AM
Re: su and SHELL environment variable
I'm back with this old issue. It seems that
I can now reproduce the problem that the
SHELL environment variable is not set
during a su -
# uname -r
B.11.11
# useradd -s /usr/bin/csh tstusr1
# printenv SHELL
/sbin/sh
# su - tstusr1 -c 'printenv SHELL'
(c)Copyright 1983-2000 Hewlett-Packard Co.,
/sbin/sh
But this happens only when I'm logged in via
ssh. When logged in via rlogin on the same
machine the output of the printenv command
is the expected
/usr/bin/csh
The environment of both shells is almost identical. The differences are:
2a3
> SSH2_SFTP_LOG_FACILITY=-1
7a9,10
> USER=root
> DISPLAY=10.80.5.181:13.0
8a12
> SSH2_CLIENT=10.80.5.240 57514 10.80.5.181 22
i.e. the ssh shell has some more environment variables set.
Thanks for hints.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2005 06:35 PM
06-06-2005 06:35 PM
Re: su and SHELL environment variable
just for the record. The problem occured only
when logged in via ssh from Tectia, version
4.1.*. It does not appear with newer ssh versions either from Tectia or HP provided ssh versions. However, the problem is a bug in su. I've got a patched su version from HP support but there is no official patch.
BR
Stefan Hirsch