HPE GreenLake Administration
- Community Home
 - >
 - Servers and Operating Systems
 - >
 - Operating Systems
 - >
 - Operating System - HP-UX
 - >
 - Re: Writing a file at boot
 
Operating System - HP-UX
        1840188
        Members
    
    
        3924
        Online
    
    
        110162
        Solutions
    
Forums
        Categories
Company
Local Language
                
                  
                  back
                
        
                
        
                
        
                
        
        
        
                
        
                
        
        
        
                
        
              
              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
                
                  
                  back
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
            
                
            
                
            
                
            
                
            
            
                
            
                
            
            
                
            
                
              
            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
Blogs
        Information
        Community
Resources
Community Language
        Language
        Forums
Blogs
	
		
			
            
                
            Go to solution
        
            
		
		
			
            	
	
		
        
		
	
	
		Topic Options
			
				
					
	
			
		
	- 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
 
05-10-2006 01:59 AM
05-10-2006 01:59 AM
			
				
					
					
						I want my HPUX to write a new file to a users directory in home anytime it is bounced.  I know this has to be extremely easy, but I'm having a heck of a time figuring the script out.  Anyone already have something like this you wouldn't mind passing along?  Thanks in advance.
					
				
			
			
				
			
			
				
	
			
				
		
			
			
			
			
			
			
		
		
		
	
	
	
Solved! Go to Solution.
		3 REPLIES 3
	
	            
            
		
		
			
            
                - Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
05-10-2006 02:09 AM
05-10-2006 02:09 AM
Solution
			
				
					
					
						The most straightforward approach would be to create a file in /sbin/init.d/. There is a file there called "template" which should be copied to a new file in the same directory, e.g. "rebootnews". You then modify this file in the "start" section and possibly the "stop" section to append to your logfile when the box is coming up and going down. You next step is to symbolically link this file to an entry in one of the rcN.d directories. Because /home will needed to be mounted before you perform your task, I suggest that you link it like this:
ln -s /sbin/init.d/rebootnews /sbin/rc1.d/S120rebootnews
and for the "stop" message:
ln -s /sbin/init.d/rebootnews /sbin/rc0.d/K880rebootnews
		
		
	
	
	
ln -s /sbin/init.d/rebootnews /sbin/rc1.d/S120rebootnews
and for the "stop" message:
ln -s /sbin/init.d/rebootnews /sbin/rc0.d/K880rebootnews
	If it ain't broke, I can fix that.
			
			
				
			
			
			
			
			
			
		- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
05-10-2006 02:21 AM
05-10-2006 02:21 AM
			
				
					
						
							Re: Writing a file at boot
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Denda,
or, as long as you document it, modify one of the existing files. So, for example, if you have a Oracle startup/shutdown script add your command there.
echo `date` > $USER/`date +%y%m%d%H%M`.log
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
		
		
	
	
	
or, as long as you document it, modify one of the existing files. So, for example, if you have a Oracle startup/shutdown script add your command there.
echo `date` > $USER/`date +%y%m%d%H%M`.log
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
05-10-2006 03:53 AM
05-10-2006 03:53 AM
			
				
					
						
							Re: Writing a file at boot
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Thanks to both of you!  I guess I just needed a muse for brainblock and you both gave me different ideas on how I wanted to do it.
What I ended up doing is created a generic file, then created a script that copies that file into the users home drive in rc3.d, after Oracle has started, since I know that all directories have been mounted by this time.
The users script checks for this file and if it is there, deletes it, then starts a service that can not be started via HPUX startup. Thanks to both of you!
		
		
	
	
	
What I ended up doing is created a generic file, then created a script that copies that file into the users home drive in rc3.d, after Oracle has started, since I know that all directories have been mounted by this time.
The users script checks for this file and if it is there, deletes it, then starts a service that can not be started via HPUX startup. Thanks to both of you!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
		
	
	
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP