[Cialug] How do you find when a program is used during init?

kristau kristau at gmail.com
Wed Feb 1 13:43:54 CST 2012


Um, why not just:

grep -ri ntpdate /etc/*
On Feb 1, 2012 1:20 PM, "Jeff Chapin" <chapinjeff at gmail.com> wrote:

> I believe xargs would be mildly more efficient in this case ;-)
>
> $ find /etc -type f | xargs grep -Hi ntpdate
>
> I believe this is because xargs will execute grep once for a large number
> of files, while -exec executes once per file, spawning a new process.
>
> It's a minor point, but I so rarely get to share it....
>
> Yes, I am a huge nerd. Why do you ask?
>
> Jeff
>
> On 02/01/2012 01:13 PM, Daniel A. Ramaley wrote:
>
>> It might be faster to go with the other suggestion of renaming ntpdate,
>> but if you'd like to learn more about how the system works you can find
>> all occurrences of ntpdate with something like this:
>>
>>     $ find /etc -type f -exec grep -Hi ntpdate {} \; 2>  /dev/null
>>
>> I'll leave it as an exercise to the reader to find a more efficient way
>> to do that; the "find ... -exec grep ..." is just the idiom i find most
>> intuitive.
>>
>> On 2012-02-01 at 12:18:27, Nathan C. Smith wrote:
>>
>>> On a custom Debian-based distribution, ntpdate is being used in the
>>> startup, but I don't know where.  I'd like to find it and comment it
>>> out to test something.  What is the best way to track down a program
>>> that is running during init?  Is there a way to know at what runlevel
>>> it is running?
>>>
>>> I've looked in /etc/init.d and in rc0.d and others but nothing is
>>> jumping out.
>>>
>>> Thanks for any tips or pointers.
>>>
>>>
>>> -Nate
>>> ______________________________**_________________
>>> Cialug mailing list
>>> Cialug at cialug.org
>>> http://cialug.org/mailman/**listinfo/cialug<http://cialug.org/mailman/listinfo/cialug>
>>>
>> __
>> Daniel A. Ramaley
>> Network Engineer 2
>>
>> Dial Center 112, Drake University
>> 2407 Carpenter Ave / Des Moines IA 50311 USA
>> Tel: +1 515 271-4540
>> Fax: +1 515 271-1938
>> E-mail: daniel.ramaley at drake.edu
>> ______________________________**_________________
>> Cialug mailing list
>> Cialug at cialug.org
>> http://cialug.org/mailman/**listinfo/cialug<http://cialug.org/mailman/listinfo/cialug>
>>
> ______________________________**_________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/**listinfo/cialug<http://cialug.org/mailman/listinfo/cialug>
>


More information about the Cialug mailing list