Slight cleanup of syslog.conf.

* Avoid mkdir of /var/run/rsyslog if it already exists for a slight speedup.

* Use 'install' for mkdir of /var/run/rsyslog, which allows us to get the permissions right from the start.  This lets us avoid a 'chmod -R' later.

* Only chmod the kmsg pipe if we created it, so we can avoid the chmod -R.

* nit: use "if [ ! -p ... ]" rather than "test ||".  Both are equally valid, but the if syntax seems to be more commonly used in our scripts.

* Indentation / spacing as per jrbarnette suggestions.

* All variables use ${VAR} syntax.

Possible bugs (please reject this review if you think any of these can happen):

* We now only do chown to files that we created, and only do the chown when we create them.  If somehow we were relying on chowning other files, that behavior will now be broken.

TEST=Ad-hoc.  Placed the meat of the script into a file ( so I could run it manually.  Then, did:

sudo dash -x

sudo rm -f /var/run/rsyslog/kmsg
sudo dash -x

ls -al /var/run/rsyslog

sudo rm -rf /var/run/rsyslog
sudo dash -x

ls -al /var/run/rsyslog

Review URL:

Change-Id: Ia37277faf1cd78f50cef6c3ccb3e6ea426aab4ab
1 file changed