Tag Info

New answers tagged

0

You could use the ~./bash_logout if it's for when users log off (note, bash shell, e.g ssh). But some other situations are also described in the article/answer below, superuser.com: create-a-logoff-script-task-for-linux @heemayl and others already describe some of the commands you can use to get the still running processes when the users logs off. If you ...


3

This answer by Radu gives you a complete overview of how to execute particular script upon logout or shutdown. What you can do is create the script like this #!/bin/bash ps -u username > /home/yourusername/outputfile.txt Then sudo chmod +x scriptname and add line session-cleanup-script=/path/to/script to /etc/lightdm/lightdm.conf As for shutdown . ...


1

You can run htop from one of the tty consoles so that you can log a user out of an xsession but still maintain an open terminal (htop is better than top and easier to read). CTRL + ALT + F2 You can login a text session under a different username from there and then, use: sudo htop to start it up. Use F6 and then scroll up to USER using the arrow button ...


1

Use the following to list all the processes of any particular user: $ ps -fu "username" For example: $ ps -fu foobar To save it in a file: $ ps -fu foobar > ~/ps_foobar Here is a one liner that can be used via cron or any other repitition mechanism: [[ $(ps -u foobar | wc -l) -gt 1 ]] && echo "user foobar has process running" || echo ...


3

You're on the right track: I would also have one user watching the other. If top doesn't give you the output you want I would use ps aux in an infinite loop with a 1 second delay. #!/bin/bash # Example script for watching a logging off user # This script is an answer to ...


0

In terminal type: kill -9 "pid number for the process" For example: kill -9 5624 (number 9 is the code for kill signal) To get the PID number for the process either use: ps -eLF or you could use the command: top Every process will have it's own PID number. The reason for this is because processes can be named the same.


4

You can't. Not without killing the whole process. From man 3 pthread_kill, a function used for signal handling: NOTES Signal dispositions are process-wide: if a signal handler is installed, the handler will be invoked in the thread thread, but if the disposition of the signal is "stop", "continue", or "terminate", this action will ...


2

You can use killall. The simplest syntax is: killall "Process_name" In you case: killall "node --harmony app.js" The upside of killall is that it will match the exact name so there is no chance of killing other processes unwantedly. Although you can use -r option to express the process as a regular expression pattern like pkill. Check man killall ...


1

Use an alias and your own "command word" for it. E.G.go to your home Dir and create the file .bash_aliases Put the following text into the file alias nerdalert='pkill -f "node --harmony app.js"' and then search in your home folder for your .bashrc looking for this part and make sure it's not commented out. # Alias definitions. # You may want to put all ...


3

Use pkill: pkill node This would match the other command as well, so fine tune it: pkill -f "node --harmony app.js" This matches the full command line (-f) exactly, so it should only hit the desired command.


0

You can get process info using: $ ps -f --pid $(xprop _NET_WM_PID | grep -o '[0-9]*')


0

Edit file /etc/sysctl.conf and edit this section: #net.ipv4.ip_forward = 0 to net.ipv4.ip_forward = 1 (remove # sign) then type command: sysctl -p Last, reboot your system.


2

It is not Ubuntu that does this. It is the Linux kernel that does this. Wikipedia has a topic on this: Out of memory (OOM) is an often undesired state of computer operation where no additional memory can be allocated for use by programs or the operating system. Such a system will be unable to load any additional programs, and since many programs may ...


0

I had the same problem but you can't just do one service apache2 stop command - you have to do one PER process. Then, you MAY want to add a sudo in front just in case you're logged into some odd account that needs it so if you see 9 processes running, do 9 sudo service apache2 stop Worked great for me.


0

One thing that many other answers are missing is how to detach a running process that currently blocks the shell. In most terminals and shells, Ctrl+Z will halt the running process and bring you back to an input prompt. Then, you can issue bg to send the running process into the background. Issue fg instead to put the running process back into the ...


0

I am chasing a similar issue and I am using intotify to see what files have been accessed to track down the program that is accessing them. This command will watch a specific directory for X minutes: inotifywatch -v -e access -e modify -t "$TIME" -r "$STORAGE" Replace "$TIME" with the length in seconds to watch for and "$STORAGE" with the directory you ...



Top 50 recent answers are included