Hi again,

2011/1/24 Harald Jenny <har...@a-little-linux-box.at>:
> first thanks to everbody for the valuable input, it helped me a lot to improve
> this init script. Please take a look at the third version of my patch and
> comment on it.

Overall it seems fine, just a few observations:

1) usually you should enclose with "" the full path here:
+PIDFILE=/var/run/amavis/"$NAME".pid
+[ -r /etc/default/"$NAME" ] && . /etc/default/"$NAME"

Also, $NAME is not usually quoted with "" in any init script.

2) You should make sure that you don't get it this situation:
+if [ -n "$PIDFILE" ]; then
...
+else
+  log_failure_msg "Error: PIDFILE variable must be defined for
correct functionality"
+  exit 1
+fi

This is usually done by setting the default values (for example for
PIDFILE) after you have sourced the config from /etc/default/$NAME.
This is done on a test like this:
test -z "$VAR" || VAR="<your default value>"
(I don't recommend "test -n $VAR && .. not that good with "set -e")

You should consider all variables essential to amavisd-milter startup
and runtime.

3) Replace these to work with "set -e":
+[ -n "$AMAVISSOCKET" ] && ..
with
+[ -z "$AMAVISSOCKET" ] || ..

Thanks



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to