- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- init s and rc0 script
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
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
тАО03-09-2011 06:53 AM
тАО03-09-2011 06:53 AM
init s and rc0 script
I am new on tru64 system, i started to look around a bit and stoped by rc0 script wich is doing all the job during the system shutdown. One thing i just can't get is that in inittab the single user mode is deffined as:
ss:Ss:wait:/sbin/rc0 shutdown < /dev/console > /dev/console 2>&1
but then when i open rc0 the end of this script is like:
if [ "$ARGONE" = shutdown ]; then
/sbin/init S
else
echo "The system is down."
sync
/sbin/halt -q
so its calling the "init S" command again and thats very strange. How is it possible that this sequence doesn't loop the whole system into executing "rc0 shutdown" again and again...? i see no other condition in the script wich could block the loop...
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 01:11 AM
тАО03-14-2011 01:11 AM
Re: init s and rc0 script
Could you guys atleast tell me whats the line
/sbin/kill -USR1 $SPECIALPID
doing?
It looks like it sends USR1 signal to the init process. But what does it mean for the init?
How is init interpreting the USR1 signal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 04:32 AM
тАО03-14-2011 04:32 AM
Re: init s and rc0 script
On HP-UX, you only execute the rc0 scripts if you transition to that runlevel. Not if you are already at that runlevel.
>It looks like it sends USR1 signal to the init process. But what does it mean for the init?
Yes, it sends USR1 to $SPECIALPID.
You'll need to look at the documentation for init(8).
Unfortunately I don't see anything obvious:
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/MAN/MAN8/0166____.HTM
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50_HTML/MAN/MAN1/0237____.HTM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 04:53 AM
тАО03-14-2011 04:53 AM
Re: init s and rc0 script
Its obvios that init do not load rc0 again when the system is in single user already. But where is the condition?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2011 03:22 AM
тАО05-04-2011 03:22 AM
Re: init s and rc0 script
So, running "init S" would cause the main init process to "think" something like "OK, we're already in single-user mode and we already did /sbin/rc0, so there is nothing at all to do."
The point of having "/sbin/init S" instead of just exiting the script is mysterious to me: perhaps some side-effect of re-executing /sbin/init is desired? (It might be triggering the main init process to re-read the inittab file, in case it's been changed; perhaps this is for firmware updates or some other thing that requires system to automatically go to single-user mode, do something and return to normal mode.)
At that point, the single-user shell (or root login prompt, if single-user mode can be password-protected in tru64) is invoked, most likely by program code embedded in /sbin/init itself. That is likely to be the same code that gets executed if you are booting a system whose inittab file has accidentally become empty or deleted.
The only way to know for sure would be to read the source code of /sbin/init.
MK