DescriptionSlight cleanup of syslog.conf.
Changes:
* 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.
BUG=chromium-os:13510
TEST=Ad-hoc. Placed the meat of the script into a file (syslog.sh) so I could run it manually. Then, did:
sudo dash -x syslog.sh
# Validated that proper dash commands were executed
sudo rm -f /var/run/rsyslog/kmsg
sudo dash -x syslog.sh
# Validated that proper dash commands were executed
ls -al /var/run/rsyslog
# Validated correct files / permissions (. and kmsg should both exist and be owned by syslog)
sudo rm -rf /var/run/rsyslog
sudo dash -x syslog.sh
# Validated that proper dash commands were executed
ls -al /var/run/rsyslog
# Validated correct files / permissions (. and kmsg should both exist and be owned by syslog)
Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=05873d4
Patch Set 1 #Patch Set 2 : Use install; no hacky chown -R. #
Total comments: 4
Patch Set 3 : jrbarnette review feedback. #Messages
Total messages: 4 (0 generated)
|