Bug#931719: 40-systemd: line 11: 1: unbound variable when sourcing /lib/lsb/init-functions with $1 unset

Michael Biebl biebl at debian.org
Wed Jul 17 12:08:33 BST 2019


On Thu, 11 Jul 2019 18:41:01 +0300 Mert Dirik <mertdirik at gmail.com> wrote:
> On 7/11/19, Thomas Bätzler <thomas at baetzler.de> wrote:
> >
> > To wit:
> >
> >   root at kvm1:~# /etc/init.d/rsync
> >   Usage: /etc/init.d/rsync {start|stop|reload|force-reload|restart|status}
> >
> > vs.
> >
> >   root at kvm1:~# /etc/init.d/mysql
> >   /lib/lsb/init-functions.d/40-systemd: line 11: 1: unbound variable
> >
> >
> 
> Thanks, I've been able to confirm that.
> 
> > In this case, line 16 has to be changed to 'argument="${1:-}', too (last
> > line of your patch), since the call without argument falls through to
> > the else branch, i.e.
> 
> Indeed. "argument=$1" line had need to be changed, not the
> "argument=$2" one. Can you try this patch:

[..]

Any updates here? Thomas, were you able to test this patch?
Mert, is this the patch you'd like to see applied?

>          executable="$__init_d_script_name"
>          argument="$1"
>      elif [ "${0##*/}" = "init-d-script" ] ||
> -         [ "${0##*/}" = "${1##*/}" ]; then # scripts run with old
> init-d-script
> +         [ "${0}" = "${1:-}" ]; then # scripts run with old  init-d-script
>          executable="$1"
>          argument="$2"
>      else # plain old scripts
>          executable="$0"
> -        argument="$1"
> +        argument="${1:-}"
>      fi
> 
> 

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20190717/feddd6db/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list