Originally posted by AUSanders79 Now what about the "|| true" part of the command?
|| stands for Logic OR in many programming and scripting languages, including the language bash uses. In scripts it's mostly used to handle errors*. In this case, bash would do the following when it encounters
/bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null || true
1) Do cat with the 'option' /var/run/syslogd.pid and redirect stderr to /dev/null.
This will send the process id of syslogd to stdout.
2) Do /bin/kill with the option -HUP plus what was sent to stdout by the last command.
3) Think about ||.
If the last expression resulted in a nonzero value, stop evaluation and return 1. Otherwise, continue evaluation and return 0 when the next expression is 0 and 1 when it's nonzero.
4) Do true.
This just returns 1.
The function of the script is to send a HUP signal to syslogd and make sure the user gets no errors
at all. File descriptor 2 is redirected to /dev/null and the return value of the expression is always 1.
* If people don't believe me, than think about why there are so much occurences of "or die(...)" in PHP scripts.