- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Searching complete / for sudo
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
06-08-2006 05:13 AM
06-08-2006 05:13 AM
I have generated a complete listing of files in system. This comes to 414874 files which we need to search. I am looking for some script where it should search all files in this listing without any wait period and if it hangs anywhere, ONLY then it should wait for 30 seconds and then kill the grep for that file and proceed to search on next file in listing. Or if there is any better way to do this. Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 05:21 AM
06-08-2006 05:21 AM
Re: Searching complete / for sudo
If so there is no need to modify the scripts that contain the sudo call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 05:25 AM
06-08-2006 05:25 AM
Re: Searching complete / for sudo
But like Rick says, if your sudo stays at the same place when you upgrade it, there is no need to do anything, the scripts will
run the new version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 05:30 AM
06-08-2006 05:30 AM
Re: Searching complete / for sudo
OLD@xxx:#sudo -V
usage: sudo [ [ -r | -e ] name ] [ cmd [ args ]]
sudo [ -l name ]
NEW!hxs $ sudo -V
Sudo version 1.6.6
Once I put this sudo 1.6.6, Some of scripts using sudo fail. So before going ahead of upgrade sudo on PROD systems I wanted to make sure how many scripts are using sudo. Find owners of those scripts, contact them and have them modify it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 05:42 AM
06-08-2006 05:42 AM
Re: Searching complete / for sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 05:47 AM
06-08-2006 05:47 AM
Re: Searching complete / for sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 05:51 AM
06-08-2006 05:51 AM
Re: Searching complete / for sudo
(configurable in the /etc/sudoers file)
You may check sudo entries in the system log
grep -i sudo /var/adm/syslog/syslog.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 05:58 AM
06-08-2006 05:58 AM
Re: Searching complete / for sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:12 AM
06-08-2006 06:12 AM
Re: Searching complete / for sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:23 AM
06-08-2006 06:23 AM
Re: Searching complete / for sudo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:26 AM
06-08-2006 06:26 AM
Re: Searching complete / for sudo
This command hangs here -
# ll /etc/opt/resmon/pipe/1573980217
prw------- 1 root root 0 Jul 30 2003 /etc/opt/resmon/pipe/1573980217
# grep -il sudo /etc/opt/resmon/pipe/1573980217
Thats why I am looking for some scripts. Please see my question again.
Thanks
Hemant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:30 AM
06-08-2006 06:30 AM
Re: Searching complete / for sudo
for i in `cat my_file_list`
do
grep -i 'sudo' $i
done
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:41 AM
06-08-2006 06:41 AM
Re: Searching complete / for sudo
I have also tried to use a similar script but it hangs when is goes for a file like this - And I am tired killing those infinite greps.
prw------- 1 root root 0 Jul 30 2003 /etc/opt/resmon/pipe/1573980217
And some other files with names FIFO in it.
So I am looking for some script where it should search a file in this listing and go for next $i WITHOUT any wait period and if it hangs anywhere, ONLY then it should wait for 30 seconds and then kill the grep for that $i if it is still hanging and then proceed to search on next file in listing.
I am using - grep -l sudo $i > /tmp/result.out. As if any file has sudo word in it will be written to this result.out.
Any help is really appreciated.
Thanks
Hemant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 06:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 07:31 AM
06-08-2006 07:31 AM
Re: Searching complete / for sudo
to exclude pipes, sockets, directories and not querying symlinks, use
find / -local -type f -print | xargs fgrep -l sudo >/tmp/result
I don't know if HPUX-find has '-local' option (have no HP at hand now) to inhibit walking into NFS-mounts, but there may be an option '! -fstype nfs' or so as a substitute.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 07:58 AM
06-08-2006 07:58 AM
Re: Searching complete / for sudo
find / -type f -local -exec file {} \; | awk -F ':' '/text$/{print $1}' | xargs grep -l 'sudo'
If you already have a list of files, replace everything before the first pipe with 'cat filelist'.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2006 02:41 AM
06-09-2006 02:41 AM
Re: Searching complete / for sudo
- Hemant