Linux "top": how to tell which process is what? [closed] - linux

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have several cron jobs (calling my PHP scripts via curl) in the background that are running. I'm trying to monitor their performance. Using top, I see a bunch of httpd commands -- but I have a feeling these do not represent the cron jobs (e.g. too many httpd exit for the cron tasks being called).
How can I know what the httpd processes are for sure? Are there any other tools I should be looking at to monitor my system?

What you want is to look in /proc/[pid]/status.

You can get a hierarchically overview about your running processes with ps efaux or pstree -A -p
Maybe that helps.

Related

How can stop, restart or see console log of startup application? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I set that binary to run startup using ubuntu Startup Application. After restart application is running but I don't know how to see it's console log or stop or restart it.
First of all, you can find the PID of your application using:
ps -a | grep <PROCESS-NAME>
After that, you can attach to the process with certain PID and observe the standard output and standard error using (to detach press Ctrl + c):
strace -p <PID> -e write=1,2
If you want to stop your application, your can terminate it:
kill -SIGTERM <PID>
or using process name:
pkill <PROCESS-NAME>

Local Linux user that automatically executes a command thyat can't be turned off [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I've spent last few hours looking for a solution for my problem which is:
I have my home server set up next to me with a small monitor attached to it. What i want to do is i want to create an additional user called "monitor" that executes command "nethogs eth1" straight after it has been logged one locally on the machine, and does not allow to turn off the script.
Basically i want nethogs running 24/7 on my monitor, without way to turn it off.
Please help me if you know the solution.
sudo adduser monitor
echo "sudo -u monitor nethogs eth1" >> /etc/rc.local
Each time your machine boots, it will execute nethogs eth1 as user monitor, and only root or monitor itself can stop that command.

Is it possible to forward the output of "service httpd restart" for example to "notify-send $output"? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
If I create a script that will restart apache:
service httpd restart
... I will never know what the output was because it does not open the terminal window.
I am wondering if the output can be taken and then forwarded to:
notify-send output
... this way there is some visual of what happened for few seconds on the screen.
First, you really should look inside the terminal when running your script.
Also, notice that services are started before login time (at boot time).
And server daemons like Apache or Lighttpd have their own log files usually under /var/log/;
You could put the output of service httpd restart command into some variable like
restart_msg=$(service httpd restart 2>&1)
where 2>&1 redirects stderr to stdout
then you can show that with
notify-send "HTTPD restarted" "$restart_msg"
But I don't think all this is a good idea. You should take the habit of restarting services inside a terminal and have a look at the output (in the rare case something gets wrong, you'll need all of it).
Read the Advanced Bash Scripting Guide.

Skip cron job for a few hours [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was wondering if it was possible to tell cron to not execute any cron jobs for a couple hours ?
As shannonman mentioned, you can just stop the service and start it again when required.
Stop cron service
$ sudo /etc/init.d/cron stop
Start cron service
$ sudo /etc/init.d/cron start
Reference

Unauthorised Perl Scripts [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
One of my servers just had the memory exhausted by a load of Perl scripts, we use plesk and they seem to have appeared under the /var/www/vhosts/domainexample.com/cgi-bin/ directory, I managed to stop all of the processes and delete the scripts but I have absolutely no idea how they would've got there.
Can someone point me in the right direction in order to prevent further attacks?
Who should have access to your webserver machine?
Does this include the owner/operator of domainexample.com?
Do you expect the owner to be placing cgis on your server?
Does domainexample.com need to run cgis?
does domainexample.com need to run perl?
You might want to start researching here:
http://httpd.apache.org/docs/current/misc/security_tips.html

Resources