Ps provides numerous options for manipulating the output according to our need. proc contains virtual files, which is the reason it’s referred as a virtual file system. It reads the process information from the virtual files in /proc file-system. The ps command is used to list the currently running processes and their PIDs along with some other information, which depends on different options. Linux provides a utility called ps (which stands as abbreviation for “Process Status ”) for viewing information related with the processes on a system. You'll come to the conclusion that no processes belonging to the logged-off user are running any more after they've logged off completely.\) # You DID NOT receive a copy of the GNU General Public License along with this program as the license is bigger then this program. See the GNU General Public License for more details. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. # Example script for watching a logging off user If top doesn't give you the output you want I would use ps aux in an infinite loop with a 1 second delay. You're on the right track: I would also have one user watching the other. OS Information: Description: Ubuntu 14.10 Please let me know if you need any more information. I was thinking about perhaps running a logging script as root automatically, but as well as it being a bit of a possible security risk, it would probably give me the same scrambled output as I got from top before. So I am wondering if there is a way to better achieve what I am trying to achieve? And if anybody could give me any suggestions on maybe how I could improve my methods, or suggest some new methods. I have already tried for instance to log which processes are still active after a certain user session logs out by having an admin account active at the same time as another account, so that while the other account is logging out the admin account will be logging the process activity with: top > ~/top.txtīut there were two problems with that, firstly it would not allow for me to tell anything about the processes which are active during the shutdown process (well as much of it as I could log before the logging process gets terminated), and secondly the output into the text file was unreadable for me because most lines looked something like this:Īnd although I can pick this apart and by looking at an actual example of top running in my CLI, I can tell what some bits are, but it's really hard to tell with what I have got to do, plus I don't know at which points what happened, I don't know if one of the outputs in the file is before the log out, or after, or some point during, and it is just really hard to read. It would also be useful for me to be able to log the processes still active during as much of the shutdown process as possible. And I need to specifically be able to also tell to which user those processes belong to. ![]() ![]() I am needing to do some debugging work, and as a part of that debugging work I need to know if there are any processes still running after a user session has logged out.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |