<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Searching complete / for sudo in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984007#M420464</link>
    <description>Hi Pete&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;prw-------   1 root       root             0 Jul 30  2003 /etc/opt/resmon/pipe/1573980217&lt;BR /&gt;&lt;BR /&gt;And some other files with names FIFO in it. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I am using - grep -l sudo $i &amp;gt; /tmp/result.out. As if any file has sudo word in it will be written to this result.out.&lt;BR /&gt;&lt;BR /&gt;Any help is really appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;Hemant</description>
    <pubDate>Thu, 08 Jun 2006 13:41:30 GMT</pubDate>
    <dc:creator>Hemant S.</dc:creator>
    <dc:date>2006-06-08T13:41:30Z</dc:date>
    <item>
      <title>Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983995#M420452</link>
      <description>Before upgrading sudo, we need to check if any scripts are using sudo. For this I tried to search ALL files using find / -exec grep -l 'sudo' {} \; &amp;gt; /tmp/result. But this hangs in between while searching lot of files and I can can not keep killing every process where it hangs.(Example /etc/opt/resmon/pipe/153355665 ) So what is the best way searching complete system.&lt;BR /&gt;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.</description>
      <pubDate>Thu, 08 Jun 2006 12:13:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983995#M420452</guid>
      <dc:creator>Hemant S.</dc:creator>
      <dc:date>2006-06-08T12:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983996#M420453</link>
      <description>If you are upgrading sudo, are you keeping the same PATH to the executables?&lt;BR /&gt;&lt;BR /&gt;If so there is no need to modify the scripts that contain the sudo call.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 12:21:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983996#M420453</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2006-06-08T12:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983997#M420454</link>
      <description>It would be a lot easier to check the sudo log: /var/adm/syslog/sudo.log to see what scripts/users are using it.&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;run the new version.</description>
      <pubDate>Thu, 08 Jun 2006 12:25:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983997#M420454</guid>
      <dc:creator>Christian Tremblay</dc:creator>
      <dc:date>2006-06-08T12:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983998#M420455</link>
      <description>The sudo we have on this box is very very OLD. Does not show any version. And command syntax is lot different from the rest sudo executable. &lt;BR /&gt;OLD@xxx:#sudo -V&lt;BR /&gt;usage:  sudo [ [ -r | -e ] name ] [ cmd [ args ]]&lt;BR /&gt;        sudo [ -l name ]&lt;BR /&gt;NEW!hxs $ sudo -V&lt;BR /&gt;Sudo version 1.6.6&lt;BR /&gt;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.</description>
      <pubDate>Thu, 08 Jun 2006 12:30:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983998#M420455</guid>
      <dc:creator>Hemant S.</dc:creator>
      <dc:date>2006-06-08T12:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983999#M420456</link>
      <description>Like I said, check the sudo log, all invocations of sudo by a script are logged there with the name of the script that called it.</description>
      <pubDate>Thu, 08 Jun 2006 12:42:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4983999#M420456</guid>
      <dc:creator>Christian Tremblay</dc:creator>
      <dc:date>2006-06-08T12:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984000#M420457</link>
      <description>There is no /var/adm/syslog/sudo.log present,  or any other sudo log. The files which it use is /etc/suid_tab and /etc/suid_local not sudoers.</description>
      <pubDate>Thu, 08 Jun 2006 12:47:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984000#M420457</guid>
      <dc:creator>Hemant S.</dc:creator>
      <dc:date>2006-06-08T12:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984001#M420458</link>
      <description>by default sudo will log to the system log in /var/adm/syslog/syslog.log but it's a good idea to log to it's on log file&lt;BR /&gt;(configurable in the /etc/sudoers file)&lt;BR /&gt;&lt;BR /&gt;You may check sudo entries in the system log&lt;BR /&gt;grep -i sudo /var/adm/syslog/syslog.log&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 12:51:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984001#M420458</guid>
      <dc:creator>Christian Tremblay</dc:creator>
      <dc:date>2006-06-08T12:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984002#M420459</link>
      <description>As I said there is no /etc/sudoers present. Also I don't want to depend on sudo entries in syslog.log. Is there any way to search ALL files in a system for use of command sudo.</description>
      <pubDate>Thu, 08 Jun 2006 12:58:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984002#M420459</guid>
      <dc:creator>Hemant S.</dc:creator>
      <dc:date>2006-06-08T12:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984003#M420460</link>
      <description>for i in `find / -type f`;do grep -i sudo $i;done 2&amp;gt;&amp;amp;1 &amp;gt;&amp;gt; search.out</description>
      <pubDate>Thu, 08 Jun 2006 13:12:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984003#M420460</guid>
      <dc:creator>Christian Tremblay</dc:creator>
      <dc:date>2006-06-08T13:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984004#M420461</link>
      <description>You may want to use grep -il to output only the file names where a match is found.</description>
      <pubDate>Thu, 08 Jun 2006 13:23:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984004#M420461</guid>
      <dc:creator>Christian Tremblay</dc:creator>
      <dc:date>2006-06-08T13:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984005#M420462</link>
      <description>Christian&lt;BR /&gt;&lt;BR /&gt;This command hangs here -&lt;BR /&gt;# ll /etc/opt/resmon/pipe/1573980217&lt;BR /&gt;prw-------   1 root       root             0 Jul 30  2003 /etc/opt/resmon/pipe/1573980217&lt;BR /&gt;# grep -il sudo /etc/opt/resmon/pipe/1573980217&lt;BR /&gt;&lt;BR /&gt;Thats why I am looking for some scripts. Please see my question again.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Hemant</description>
      <pubDate>Thu, 08 Jun 2006 13:26:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984005#M420462</guid>
      <dc:creator>Hemant S.</dc:creator>
      <dc:date>2006-06-08T13:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984006#M420463</link>
      <description>You said you generated a list of the 414874 files that need to be searched.  Use that list:&lt;BR /&gt;&lt;BR /&gt;for i in `cat my_file_list`&lt;BR /&gt; do&lt;BR /&gt;  grep -i 'sudo' $i&lt;BR /&gt; done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 08 Jun 2006 13:30:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984006#M420463</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-06-08T13:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984007#M420464</link>
      <description>Hi Pete&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;prw-------   1 root       root             0 Jul 30  2003 /etc/opt/resmon/pipe/1573980217&lt;BR /&gt;&lt;BR /&gt;And some other files with names FIFO in it. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I am using - grep -l sudo $i &amp;gt; /tmp/result.out. As if any file has sudo word in it will be written to this result.out.&lt;BR /&gt;&lt;BR /&gt;Any help is really appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;Hemant</description>
      <pubDate>Thu, 08 Jun 2006 13:41:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984007#M420464</guid>
      <dc:creator>Hemant S.</dc:creator>
      <dc:date>2006-06-08T13:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984008#M420465</link>
      <description>it's important that you use the -type f switch to the find command to look only at regular files not at a named pipe where you say it hangs.</description>
      <pubDate>Thu, 08 Jun 2006 13:41:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984008#M420465</guid>
      <dc:creator>Christian Tremblay</dc:creator>
      <dc:date>2006-06-08T13:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984009#M420466</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;to exclude pipes, sockets, directories and not querying symlinks, use&lt;BR /&gt;find / -local -type f -print | xargs fgrep -l sudo &amp;gt;/tmp/result&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Thu, 08 Jun 2006 14:31:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984009#M420466</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-06-08T14:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984010#M420467</link>
      <description>This works on my system, and makes doubly sure that only text files are grep'ed:&lt;BR /&gt;&lt;BR /&gt;find / -type f -local -exec file {} \; | awk -F ':' '/text$/{print $1}' | xargs grep -l 'sudo'&lt;BR /&gt;&lt;BR /&gt;If you already have a list of files, replace everything before the first pipe with 'cat filelist'.&lt;BR /&gt;&lt;BR /&gt;PCS&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 14:58:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984010#M420467</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-06-08T14:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Searching complete / for sudo</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984011#M420468</link>
      <description>Thanks for your help Christian. &lt;BR /&gt;- Hemant</description>
      <pubDate>Fri, 09 Jun 2006 09:41:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/searching-complete-for-sudo/m-p/4984011#M420468</guid>
      <dc:creator>Hemant S.</dc:creator>
      <dc:date>2006-06-09T09:41:28Z</dc:date>
    </item>
  </channel>
</rss>

