Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntus, Fedora, openSUSE, and Vector Lite 6.0
Posts: 46
Rep:
process logging without using process accounting
I would like to log when a process starts and when it finishes whenever a user starts the process. What ways can this be done? I would prefer not to have to install process accounting for linux.
I would like to log when a process starts and when it finishes whenever a user starts the process.
Why (accounting, suspicion, auditing)?
What kind of user (no shell, unprivileged, wheel group, privileged)?
What kind of process (service, daemon, cronjob, at, userland one-off, background process)?
Quote:
Originally Posted by mikepeters76
I would prefer not to have to install process accounting for linux.
You didn't respond to me asking why you would prefer not to have psacct installed. Other methods would be either relatively slow or inaccurate (shell or d|inotify-based), provide excessive logging (rootsh or equivalant) or otherwise disproportional (syscall logging basically). IMHO for this task it is the ideal tool.
Distribution: Ubuntus, Fedora, openSUSE, and Vector Lite 6.0
Posts: 46
Original Poster
Rep:
two words: "change control". Accounting is not installed, I would like some sort of indication in the interim while the change control goes through - which will at least take 2 weeks. I will get it installed.
I don't mind slow, I was thinking nohup or some sort of syslogd equivalent. Is that what you mean with shell and syscall? I don't seem to have d|inotify installed either???
One quick 'n dirty method (if you don't have access to the src code) is to rename the actual app to myapp, then put a short shell script called app in its place
Presumes your users aren't smart enough to directly call the real exec. And there aren't too many scripts you need to write.
A systemtap probe would work, but if you can't get accounting past the change control pixies, a debug kernel would be no chance.
Like I said, quick 'n dirty. Also, because you rename the actual app, the users won't know what its now called unless they have a good reason to to 'check' and discover the 'app' is now a shell script, especially as I said to call it the exact same name, sans .sh extension.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.