20210528 - a Slackware upgrade causes the page rendering to fail. Apologies and I am looking for the cause.
Reported as https://forum.dokuwiki.org/d/19270-dokuwiki-instance-no-longer-rendering-some-syntax-correctly

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
slackbook:process_control [2012/09/08 19:41 (UTC)]
mfillpot [ps] updated section to match original text and formatting
slackbook:process_control [2012/10/02 00:22 (UTC)]
mfillpot [cron] removed base xml
Line 17: Line 17:
  
  
-<code>+<code bash>
 darkstar:~$ ps darkstar:~$ ps
   PID TTY          TIME CMD   PID TTY          TIME CMD
Line 45: Line 45:
  
  
-<code>+<code bash>
 darkstar:~$ ps -e darkstar:~$ ps -e
   PID TTY          TIME CMD   PID TTY          TIME CMD
Line 71: Line 71:
 <note> <note>
 This is distinct from the //-aux// argument, but in most cases This is distinct from the //-aux// argument, but in most cases
-the two arguments are equivilant. This is a decades-old relic. For more+the two arguments are equivalent. This is a decades-old relic. For more
 information, see the man page for //**ps**//. information, see the man page for //**ps**//.
 </note> </note>
  
-<code>+<code bash>
 darkstar:~$ ps aux darkstar:~$ ps aux
 USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
Line 103: Line 103:
  
  
-<code>+<code bash>
 darkstar:~$ ps -o cmd -o etime $$ darkstar:~$ ps -o cmd -o etime $$
 CMD                             ELAPSED CMD                             ELAPSED
Line 122: Line 122:
  
  
-<code>+<code bash>
 darkstar:~$ ps -o cmd -o rss -o vsz $(pgrep httpd) darkstar:~$ ps -o cmd -o rss -o vsz $(pgrep httpd)
 CMD                           RSS    VSZ CMD                           RSS    VSZ
Line 155: Line 155:
  
  
-<code>+<code bash>
 darkstar:~$ ps -ejH darkstar:~$ ps -ejH
 ... many lines omitted ... ... many lines omitted ...
Line 186: Line 186:
  
  
-<code>+<code bash>
 darkstar:~$ pstree darkstar:~$ pstree
 init-+-atd init-+-atd
Line 206: Line 206:
 ===== kill and killall ===== ===== kill and killall =====
  
-Managing processes isn't only about knowing which ones are running, but also about communicating with them to change their behavior. The most common way of managing a program is to terminate it. Thus, the tool for the job is named **kill(1)**. Despite the name, kill doesn't actually terminate processes, but sends signals to them. The most common signal is a SIGTERM, which tells the process to finish up what it is doing and terminate. There are a variety of other signals that can be sent, but the three most common are SIGTERM, SIGHUP, and SIGKILL.+Managing processes isn't only about knowing which ones are running, but 
 +also about communicating with them to change their behavior. The most 
 +common way of managing a program is to terminate it. Thus, the tool for 
 +the job is named //**kill**//(1). Despite the name, 
 +//**kill**// doesn't actually terminate processes, 
 +but sends signals to them. The most common signal is a SIGTERM, which 
 +tells the process to finish up what it is doing and terminate. There 
 +are a variety of other signals that can be sent, but the three most 
 +common are SIGTERM, SIGHUP, and SIGKILL.
  
-What a process does when it receives a signal varies. Most programs will terminate (or attempt to terminate) whenever they receive any signal, but there are a few important differences. For starters, the SIGTERM signal informs the process that it should terminate itself at its earliest convenience. This gives the process time to finish up any important activities, such as writing information to the disk, before it closes. In contrast, the SIGKILL signal tells the process to terminate itself immediately, no questions asked. This is most useful for killing processes that are not responding and is sometimes called the "silver bullet". Some processes (particularly daemons) capture the SIGHUP signal and reload their configuration files whenever they receive it. 
  
-In order to signal a process, we first need to know it's PID. You can get this easily with ps as we discused. In order to send different signals to a running process, you simply pass the signal number and [-s] as an argument. The [-l] argument lists all the signals you can choose and their number. You can also send signals by their name with [-s]. 
  
-<code>+ 
 +What a process does when it receives a signal varies. Most programs 
 +will terminate (or attempt to terminate) whenever they receive any 
 +signal, but there are a few important differences. For starters, the 
 +SIGTERM signal informs the process that it should terminate itself at 
 +its earliest convenience. This gives the process time to finish up any 
 +important activities, such as writing information to the disk, before 
 +it closes. In contrast, the SIGKILL signal tells the process to 
 +terminate itself immediately, no questions asked. This is most useful 
 +for killing processes that are not responding and is sometimes called 
 +the //"silver bullet"//. Some processes (particularly daemons) capture the 
 +SIGHUP signal and reload their configuration files whenever they 
 +receive it. 
 + 
 + 
 + 
 + 
 +In order to signal a process, we first need to know it's PID. You can 
 +get this easily with //**ps**// as we discused. In 
 +order to send different signals to a running process, you simply pass 
 +the signal number and //-s// as an argument.  The //-l// 
 +argument lists all the signals you can choose and their number. You can 
 +also send signals by their name with //-s//. 
 + 
 + 
 + 
 +<code bash>
 darkstar:~$ kill -l darkstar:~$ kill -l
  1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL  1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
Line 225: Line 257:
 </code> </code>
  
-Sometimes you may wish to terminate all running processes with a certain name. You can kill processes by name with killall(1). Just pass the same arguments to killall that you would pass to kill. 
  
-<code>+ 
 +Sometimes you may wish to terminate all running processes with a 
 +certain name. You can kill processes by name with 
 +//**killall**//(1). Just pass the same arguments to 
 +//**killall**// that you would pass to 
 +//**kill**//
 + 
 + 
 + 
 +<code bash>
 darkstar:~$ killall bash # SIGTERM darkstar:~$ killall bash # SIGTERM
 darkstar:~$ killall -s 9 bash # SIGKILL darkstar:~$ killall -s 9 bash # SIGKILL
Line 235: Line 275:
 ===== top ===== ===== top =====
  
-So far we've learned how to look at the active processes for a moment in time, but what if we want to monitor them for an extended period? top(1) allows us to do just that. It displays an ordered list of the processes on your system, along with vital information about them, and updates periodically. By default, processes are ordered by their CPU percentage and updates occur every three seconds.+So far we've learned how to look at the active processes for a moment 
 +in time, but what if we want to monitor them for an extended period? 
 +//**top**//(1) allows us to do just that. It 
 +displays an ordered list of the processes on your system, along with 
 +vital information about them, and updates periodically. By default, 
 +processes are ordered by their CPU percentage and updates occur every 
 +three seconds.
  
-<code>+ 
 + 
 +<code bash>
 darkstar:~$ top darkstar:~$ top
 top - 16:44:15 up 26 days,  5:53,  5 users,  load average: 0.08, 0.03, 0.03 top - 16:44:15 up 26 days,  5:53,  5 users,  load average: 0.08, 0.03, 0.03
Line 265: Line 313:
 </code> </code>
  
-The man page has helpful details on how to interact with top such as changing its delay interval, the order processes are displayed, and even how to terminate processes right from within top itself.+ 
 + 
 +The man page has helpful details on how to interact with 
 +//**top**// such as changing its delay interval, the 
 +order processes are displayed, and even how to terminate processes 
 +right from within //**top**// itself.
 ===== cron ===== ===== cron =====
  
-Ok, so we've learned many different ways of viewing the active processes on our system and means of signalling them, but what if we want to run a process periodically? Fortunately, Slackware includes just the thing, crond(8). cron runs processes for every user on the schedule that user demands. This makes it very useful for processes that need to be run periodically, but don't require full daemonization, such as backup scripts. Every user gets their own entry in the cron database, so non-root users can periodically run processes too. 
  
-In order to run programs from cron, you'll need to use the crontab(1). The man page lists a variety of ways to do this, but the most common method is to pass the [-e] argument. This will lock the user's entry in the cron database (to prevent it from being overwritten by another program), then open that entry with whatever text editor is specified by the VISUAL environment variable. On Slackware systems, this is typically the vi editor. You may need to refer to the chapter on vi before continuing. 
  
-The cron database entries may seem a little archaic at first, but they are highly flexible. Each uncommented line is processed by crond and the command specified is run if all the time conditions match.+Ok, so we've learned many different ways of viewing the active 
 +processes on our system and means of signalling them, but what if we 
 +want to run a process periodically? Fortunately, Slackware includes 
 +just the thing, **//crond//**(8). cron runs 
 +processes for every user on the schedule that user demands. This makes 
 +it very useful for processes that need to be run periodically, but 
 +don't require full daemonization, such as backup scripts. Every user 
 +gets their own entry in the cron database, so non-root users can 
 +periodically run processes too.
  
-<code>+ 
 +In order to run programs from cron, you'll need to use the 
 +**//crontab//**(1). The man page lists a variety of 
 +ways to do this, but the most common method is to pass the 
 +//-e// argument. This will lock the user's entry in the cron 
 +database (to prevent it from being overwritten by another program), 
 +then open that entry with whatever text editor is specified by the 
 +VISUAL environment variable. On Slackware systems, this is typically 
 +the **//vi//** editor. You may need to refer to the 
 +chapter on **//vi//** before continuing. 
 + 
 + 
 +The cron database entries may seem a little archaic at first, but they 
 +are highly flexible. Each uncommented line is processed by 
 +**//crond//** and the command specified is run if 
 +all the time conditions match. 
 + 
 + 
 +<code bash>
 darkstar:~$ crontab -e darkstar:~$ crontab -e
 # Keep current with slackware # Keep current with slackware
Line 280: Line 357:
 </code> </code>
  
-As mentioned before, the syntax for cron entries is a little difficult to understand at first, so let's look at each part individually. From left to right, the different sections are: Minute, Hour, Day, Month, Week Day, and Command. Any asterisk ***** entry matches every minute, hour, day, and so on. So from the example above, the command is //"/usr/local/bin/rsync-slackware64.sh 1>/dev/null 2>&1"//, and it runs every weekday or every week of every month at 2:30 a.m. 
  
-crond will also e-mail the local user with any output the command generates. For this reason, many tasks have their output redirected to ///dev/null//, a special device file that immediately discards everything it receives. In order to make it easier for you to remember these rules, you might wish to paste the following commented text at the top of your own cron entries.+As mentioned before, the syntax for cron entries is a little difficult 
 +to understand at first, so let's look at each part individually. From 
 +left to right, the different sections are: Minute, Hour, Day, Month, 
 +Week Day, and Command. Any asterisk <key>'*'</key> entry matches 
 +every minute, hour, day, and so on. So from the example above, the 
 +command is //"/usr/local/bin/rsync-slackware64.sh 1>/dev/null 2>&1"//, and 
 +it runs every weekday or every week of every month at 2:30 a.m. 
 + 
 + 
 +**//crond//** will also e-mail the local user with 
 +any output the command generates. For this reason, many tasks have 
 +their output redirected to ''/dev/null'', a special 
 +device file that immediately discards everything it receives. In order 
 +to make it easier for you to remember these rules, you might wish to 
 +paste the following commented text at the top of your own cron entries. 
 + 
 + 
 +<code bash>
  
-<code> 
 # Redirect everything to /dev/null with: # Redirect everything to /dev/null with:
 #   1>/dev/null 2>&1 #   1>/dev/null 2>&1
Line 291: Line 383:
 </code> </code>
  
-By default, Slackware includes a number of entries and comments in root's crontab. These entries make it easier to setup periodic system tasks by creating a number of directories in /etc corresponding to how often the tasks should run. Any script placed within these directories will be run hourly, daily, weekly, or monthly. The names should be self-explanatory: ///etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly,// and ///etc/cron.monthly//.+ 
 +By default, Slackware includes a number of entries and comments in 
 +root's crontab. These entries make it easier to setup periodic system 
 +tasks by creating a number of directories in ''/etc'' 
 +corresponding to how often the tasks should run. Any script placed 
 +within these directories will be run hourly, daily, weekly, or monthly. 
 +The names should be self-explanatory: 
 +''/etc/cron.hourly'', 
 +''/etc/cron.daily'', 
 +''/etc/cron.weekly'', and 
 +''/etc/cron.monthly''. 
 + 
 +====== Chapter Navigation ====== 
 + 
 +**Previous Chapter: [[slackbook:bash|The Bourne Again Shell]]** 
 + 
 +**Next Chapter: [[slackbook:xwindow_system|The X Window System]]** 
 ====== Sources ====== ====== Sources ======
 <!-- If you copy information from another source, then specify that source --> <!-- If you copy information from another source, then specify that source -->
- * Original source: [[http://www.slackbook.org/beta]] + * Original source: [[http://www.slackbook.org/beta]] \\
 <!-- Authors are allowed to give credit to themselves! --> <!-- Authors are allowed to give credit to themselves! -->
-<!-- * Originally written by [[wiki:user:xxx | User X]] -->+ * Originally written by Alan Hicks, Chris Lumens, David Cantrell, Logan Johnson
 <!-- * Contrbutions by [[wiki:user:yyy | User Y]] --> <!-- * Contrbutions by [[wiki:user:yyy | User Y]] -->
  

In Other Languages
QR Code
QR Code slackbook:process_control (generated for current page)