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

Nathan C. Smith nathan.smith at ipmvs.com
Wed Feb 1 13:32:22 CST 2012


That gave me a little more insight into where it was running.  I need to work harder at learning how to string together "those" types of commands and their arguments.

Apparently ntpdate is being run from both the isc-dhcpserver script and from if-up.d

Thank you Jeff and Dan.

-Nate

-----Original Message-----
From: cialug-bounces at cialug.org [mailto:cialug-bounces at cialug.org] On Behalf Of Jeff Chapin
Sent: Wednesday, February 01, 2012 1:19 PM
To: Central Iowa Linux Users Group
Subject: Re: [Cialug] How do you find when a program is used during init?

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
> __
> 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
_______________________________________________
Cialug mailing list
Cialug at cialug.org
http://cialug.org/mailman/listinfo/cialug


More information about the Cialug mailing list