- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Help !!! to understand history command configurati...
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
04-15-2011 04:34 AM
04-15-2011 04:34 AM
Help !!! to understand history command configuration
I have a HPUX11.23 server.
more /.sh_history shows the entered command by root. ( ksh is the default shell)
In the /.profile I can't see any parameters related to History!!! HISTFILE and HISTSIZE are not there.
How come the history commands are working???
To my understanding since the HISTFILE and HISTSIZE are not set in the .profile the history command should not work!!!
You help is needed guys,
- Tags:
- history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2011 04:38 AM
04-15-2011 04:38 AM
Re: Help !!! to understand history command configuration
This shows me the previous entered command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2011 04:42 AM
04-15-2011 04:42 AM
Re: Help !!! to understand history command configuration
There, now was that so hard?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2011 04:45 AM
04-15-2011 04:45 AM
Re: Help !!! to understand history command configuration
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2011 04:55 AM
04-15-2011 04:55 AM
Re: Help !!! to understand history command configuration
The issue is that to my understanding the history should not be working since no one has set the HISTFILE and HISTSIZE in the .profile.
Now the .sh_history shows the executed commands, although no one has configured it to do so??
For me that's strange.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2011 05:11 AM
04-15-2011 05:11 AM
Re: Help !!! to understand history command configuration
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2011 05:32 AM
04-15-2011 05:32 AM
Re: Help !!! to understand history command configuration
For some reason,only after rebooting the server the configuration in the .profile are applied correctly, whether it was the default or a customized history.
Now the behavior is reflecting the configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2011 06:55 AM
04-15-2011 06:55 AM
Re: Help !!! to understand history command configuration
> For some reason,only after rebooting the server the configuration in the .profile are applied correctly,
You used a sledge hammer. Apologize to your poor users. All that was necessary was to log-out and log back in to see if your newly modified profile satisfied your need.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2011 04:29 AM
04-16-2011 04:29 AM
Re: Help !!! to understand history command configuration
>To my understanding since the HISTFILE and HISTSIZE are not set in the .profile the history command should not work!
This only applies as a security measure to the Posix shell for root.
>Pete: it is generally not recommended to change root's shell from the usual posix shell.
Stronger than than that, your system will not work correctly, especially when you reboot or in single user mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2011 10:13 AM
04-16-2011 10:13 AM
Re: Help !!! to understand history command configuration
"...Try doing a man on ksh. It will tell you that the default for HISTFILE is $HOME/.sh_history and the default for HISTSIZE is 128...."
You enter HISTFILE or HISTSIZE in .profile when you want to change the DEFAULT!!!!
Else, the default is compiled into ksh.
b) Second, see Pete Randall's reply about not changing roots default shell from posix to korn, unless you want a big surprise and an unbootable system. (* perhaps you just mistated that you had changed root's shell ? *)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2011 04:53 AM
04-17-2011 04:53 AM
Re: Help !!! to understand history command configuration
1) not changing root shell:
Changing root's shell is not a Posix shell vs other shell issue (no one said that; I'm just clarifying).
It's an issue of not being contained entirely in root (/) filesystem.
When the system boots into single-user mode, the only filesystem that is mounted is /.
Therefore, root's shell must not be in or rely on anything *outside* of /.
If you notice, the root shell in /etc/passwd is '/sbin/sh', which is Posix shell that is in / and is statically-linked (self-contained code, not using shared libraries).
The file '/usr/bin/sh' is also Posix shell, *but* it
a) resides in /usr filesystem
b) uses shared libraries, which reside in /usr as well
c) is the default (HP) shell for normal login users
.
In system startup above single-user mode, users cannot log in until /usr is mounted, so using '/usr/bin/sh' for them is OK and saves memory by using sharing libraries.
You can verify the above with:
## ldd /sbin/sh
ldd: "/sbin/sh" is not a shared executable.
## ldd /usr/bin/sh
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
You could change root's shell to a statically linked shell (say, 'ksh' or 'bash') and it would work, but of course, it wouldn't be supported by HP.
So, the 'ksh' you were using was probably statically linked, which would explain why you were not having problems.
2) History:
You were correct that
. on HPUX
. for root
. when shell is HPUX Posix shell
. and HISTORY is not set in the login stream,
*then* root has no history.
This is an HP decision, not a Posix restriction.
'bash' is a Posix shell that does not have that behavior.
'ksh' (not strictly Posix compliant), as you discovered, also does not have that restriction.
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2011 01:15 AM
04-18-2011 01:15 AM
Re: Help !!! to understand history command configuration
You can't do that on Integrity, there is no libc.a available for users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2011 04:32 AM
04-18-2011 04:32 AM
Re: Help !!! to understand history command configuration
If you can't statically link it, well then it doesn't exist.
But /sbin/sh on Itanium is statically linked, so how is it created.
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2011 10:18 AM
04-18-2011 10:18 AM
Re: Help !!! to understand history command configuration
It doesn't change the theory discussed above, but it does mean that it's not easily doable on Itanium, without inside help from HP.
bv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2011 10:42 AM
04-18-2011 10:42 AM
Re: Help !!! to understand history command configuration
Magic for everything in /sbin/. ;-)
>I see that apparently HP just doesn't want anyone statically linking anymore, at least on Integrity, except themselves and a few vendors.
Exactly.