- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Inittab command as diferent user
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
тАО01-20-2010 02:05 PM
тАО01-20-2010 02:05 PM
dcam:2:once:su - aimadm2 -c "/pvh/aim/20051/decam/decam"
The machine reboots on Sun @ 1PM and I see one entry on the sulog that looks like this:
SU 01/17 13:10 + tty?? root-aimadm2
I need to make sure the dcam process is re-spawn if it dies, so I changed the inittab to look like:
dcam:2:respawn:su - aimadm2 -c "/pvh/aim/20051/decam/decam"
The issue with this is that it logs the SU attempt to the sulog several (11) times every minute, causing sulog to fill up with unecessary data (and my security audit to be on my case)
...
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
SU 01/20 17:03 + tty?? root-aimadm2
...
I'm assuming this is normall behavior, so my question is there any way to eliminate su logs from init for processes that are in normal running mode?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2010 06:14 PM
тАО01-20-2010 06:14 PM
Re: Inittab command as diferent user
su logs has mentioned earlier that its normal behaviour that it records every entry automatically to keep an record how many times root had switch user to run the said job.
so I believe its the nature of the "su logs"
wish if you could house keep the "su logs"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2010 01:53 AM
тАО01-21-2010 01:53 AM
Re: Inittab command as diferent user
All the best
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2010 04:24 AM
тАО01-21-2010 04:24 AM
Solutionsu - aimadm2 -c /usr/local/bin/decam-keeper.sh
Contents of /usr/local/bin/decam-keeper.sh:
-----
#!/bin/sh
LOGFILE=/var/adm/decam-keeper.log
RESTARTDELAY=15
# get rid of input, re-direct output and erros to our logfile
exec $LOGFILE 2>&1
while true #infinite loop
do
echo "$(date): starting decam"
/pvh/aim/20051/decam/decam
# Because there is no "&" in the decam command line,
# the script holds still while decam is running.
# If decam stops, the loop resumes,
# so if we get here, decam has died.
DECAMRESULT=$?
echo "$(date): decam exited with result code $DECAMRESULT"
sleep $RESTARTDELAY
# wait a while before restart so the repeated start attempts won't overload
# the system if decam just keeps dying
done
-----
Change the LOGFILE variable into whatever you wish: any output from decam to standard output will go into the LOGFILE.
The LOGFILE will look like this:
---
Thu Jan 21 14:12:56 EST 2010: starting decam
Sat Jan 23 04:13:02 EST 2010: decam exited with result code 2
Sat Jan 23 04:13:17 EST 2010: starting decam
---
In other words, the log file will allow you to determine exactly when and how often decam dies. You can use this log as justification for bugfix/update request, if necessary.
If you change the infinite loop into a smarter one, you could even create behaviors like "try restarting decam for X times, then give up if it keeps failing".
If you want to stop decam while it's being monitored by this script, kill the decam-keeper.sh script first, then stop decam.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2010 06:45 AM
тАО01-21-2010 06:45 AM
Re: Inittab command as diferent user
/usr/bin/su - aimadm2 -c "/pvh...
... with the full path to the su command, and see if that helps the respawning problem.
Also, check to make sure that decam isn't running into some error that's causing it to die after only a few seconds. This issue could be exposing a problem you didn't know you had with decam itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2010 11:26 AM
тАО01-21-2010 11:26 AM
Re: Inittab command as diferent user
Johnson: We're in agreement, the su logging is behaving as design. Grepping out the init logging defeats the purpose.
Matti: I greately appreciate your time in creating the script. I will use it to push the application issue with the developers
Thank you all for such high quality responses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2010 08:00 AM
тАО01-22-2010 08:00 AM
Re: Inittab command as diferent user
Thank you all