Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any possible solution to capture process entry/exit?

Tags:

c

linux

I Would like to capture the process entry, exit and maintain a log for the entire system (probably a daemon process).

One approach was to read /proc file system periodically and maintain the list, as I do not see the possibility to register inotify for /proc. Also, for desktop applications, I could get the help of dbus, and whenever client registers to desktop, I can capture.

But for non-desktop applications, I don't know how to go ahead apart from reading /proc periodically.

Kindly provide suggestions.

like image 556
Whoami Avatar asked Jan 11 '12 13:01

Whoami


People also ask

What is biometric entry/exit system?

U.S. Customs and Border Protection (CBP) is collecting facial images from all travelers departing the United States on this flight. CBP will use the images to verify each traveler's identity. CBP is authorized to collect this information by the 2002 Enhanced Border Security and Visa Entry Reform Act (Pub.

How do I apply for EES?

There is no application process or fee attached to EES as it is merely a way of recording a third country nationals' location within Europe so that person can be found or contacted more easily should the need arise.

Are there border checks in the EU?

Are there borders between EU countries? Yes, there are borders that divide European Union countries. However, since most EU member states are also in the Schengen Area, most of these are soft borders. There are no border checks in Europe between Schengen countries under normal circumstances.

How do you cross the borders in Europe?

The main items required for a border crossing are passports, vehicle registration documents, proof of insurance and green card. Always take cash, it is often needed to purchase vignettes or insurance at the border in case your policy does not cover the country you are entering.


1 Answers

You mentioned /proc, so I'm going to assume you've got a linux system there.

Install the acct package. The lastcomm command shows all processes executed and their run duration, which is what you're asking for. Have your program "tail" /var/log/account/pacct (you'll find its structure described in acct(5)) and voila. It's just notification on termination, though. To detect start-ups, you'll need to dig through the system process table periodically, if that's what you really need.

like image 151
Andrew Beals Avatar answered Oct 23 '22 03:10

Andrew Beals