- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HPUX reboot at the last| reboot
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
Discussions
Discussions
Discussions
Forums
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
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
тАО07-22-2007 11:42 PM
тАО07-22-2007 11:42 PM
HPUX reboot at the last| reboot
We are supporting large number of HPUX systems with various Model and Version. I have encounter some issue with the command "last" . Namely -
#last | reboot
This has caused the system to reboot as soon as the command was entered. The technican that was working on the system was suprise to simple mistake he has done with the incomplete of the command (#last | grep reboot) had caused the system to reboot.
I was told there is a problem using the command the way it is used (last | reboot). Can anyone help me to rectify this issue. I am affraid we might use the command again accidently again in the future and might cause the system to reboot once more. Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 11:46 PM
тАО07-22-2007 11:46 PM
Re: HPUX reboot at the last| reboot
I think you are looking for the lat reboot.
# lst | grep reboot
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 11:46 PM
тАО07-22-2007 11:46 PM
Re: HPUX reboot at the last| reboot
# last | grep reboot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 11:51 PM
тАО07-22-2007 11:51 PM
Re: HPUX reboot at the last| reboot
How can i eliminate this from happening.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2007 11:59 PM
тАО07-22-2007 11:59 PM
Re: HPUX reboot at the last| reboot
No good ways except by learning from your lessons. :-(
Take away root access from that user.
Or remove /usr/sbin from PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2007 12:03 AM
тАО07-23-2007 12:03 AM
Re: HPUX reboot at the last| reboot
I'd look at sudo if this person still needs elevated rights, but you want to stop them rebooting the server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2007 12:18 AM
тАО07-23-2007 12:18 AM
Re: HPUX reboot at the last| reboot
Patient: it hurst when I do THIS!
Doctor: Well don't do THAT then!
You may as wll say - "I drove my car the other day, and crashed it into a wall! How can I stop that happening?" - the choices are limited - driver safer or don't drive, but if you are going to drive, there's always some chance you'll crash into another wall...
In all seriousness, if this person can't be trusted to not make such mistakes, you should consider revoking root access for that person, or at least 're-training'.
Good practice says you do everything as a normal user and only access root when you know you have to. Incidentally in this case, you didn't need to be root to use that last command - here's one from my workstation logged in as oracle:
$ last | grep reboot
reboot system boot Mon Jul 23 13:02 still logged in
reboot system boot Fri Jul 20 11:14 - 13:02 (3+01:47)
reboot system boot Thu Jul 19 08:21 - 11:14 (1+02:53)
And if I made the same mistake when not logged in as root:
$ last | reboot
sh: reboot: not found.
OK - trying really hard to do something stupid now:
$ /usr/sbin/reboot
reboot: You are not super-user. Sorry.
So you see - if I stay logged in as this user, most commands will tell me if I need to be root to use.
In short "restrict and educate!"
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2007 12:19 AM
тАО07-23-2007 12:19 AM
Re: HPUX reboot at the last| reboot
You should indeed review the privileges of that technician!!
Seriously, caution should always be exercised when running commands containing "reboot", "shutdown" and "rm"
You may also wish to use:
# last |grep "reboot"
reboot system boot Sun Jul 8 23:54 still logged in
reboot system boot Sat Jun 9 04:15 - 23:54 (29+19:39)
#
Anyway, users else than users with root privileges can also issue: last |grep reboot
bad luck!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2007 12:33 AM
тАО07-23-2007 12:33 AM
Re: HPUX reboot at the last| reboot
Coution should be used while driving, yes Duncan I agree, here onwards.