Bug#843419: init-d-script: please provide a way to not use the --name option of start-stop-daemon
wferi at niif.hu
wferi at niif.hu
Sun Feb 24 12:24:51 GMT 2019
control: tags -1 -moreinfo
Dmitry Bogatov <KAction at debian.org> writes:
> Sorry, I do not understand. You, as init script writer, choose value of
> argument to $NAME. Why can't you limit it to required length?
Sorry, I indeed left out important context, thus even I had difficulty
recalling the reason for my report now. So:
I use /lib/init/init-d-script to provide an init script for the
corosync-qdevice daemon. I have to set NAME="corosync-qdevice", because
the NAME variable is used in several informational messages as well
besides as the --name value for start-stop-daemon. But then I have to
override the do_start_cmd() and do_stop_cmd() shell functions to use the
correct --name value (or not use one at all). The other choice would be
letting the informational messages use the truncated name, which is
suboptimal in a different (and visible) way.
I imagine that having an optional COMM_NAME (pick any name) variable
would solve this nicely, if it was used in preference to NAME for the
--name option of start-stop-daemon if it was set, like
start-stop-daemon --name "${COMM_NAME:-$NAME}"
or maybe even (just an untested idea):
if [ -n "${COMM_NAME:=$NAME}" ]; then
NAME_ARG="--name=$COMM_NAME"
else
NAME_ARG=""
fi
[...]
start-stop-daemon [...] "$NAME_ARG" [...]
--
Thanks,
Feri
More information about the Debian-init-diversity
mailing list