Bug#1003609: readlink: invalid option -- 'b' in /lib/lsb/init-functions.d/40-systemd

Michael Biebl biebl at debian.org
Wed Jan 12 18:28:03 GMT 2022


Am 12.01.22 um 18:31 schrieb Peter Palfrader:
> On Wed, 12 Jan 2022, Michael Biebl wrote:
> 
>> Am 12.01.22 um 16:04 schrieb Peter Palfrader:
>>> /lib/lsb/init-functions.d/40-systemd calls
>>>     readlink -f "$executable"
>>> which causes warnings if an executable starts with -, like in "-bash" when
>>> /lib/lsb/init-functions is sourced from a login shell.
>>>
>>> ] root at yukon:~# . /lib/lsb/init-functions
>>> ] readlink: invalid option -- 'b'
>>> ] Try 'readlink --help' for more information.
>>> ] root at yukon:~#
>>>
>>> This happens for instance with the slony init script:
>>>
>>> | adns002:~# grep 'init-functions ' /etc/init.d/slony1
>>> |                 su -c ". /lib/lsb/init-functions ; umask 027 ; start_daemon -p $(pidfile $1) $DAEMON -f $(conffile $1) -p $(pidfile $1) >>$(logfile $1) 2>&1 </dev/null &" - postgres
>>
>> Oh my, not the prettiest way to start a daemon.
>> Christoph, maybe this is actually better addressed on the slony1-2 side.
> 
> I completely agree that it should /also/ be addressed there, but
> nevertheless, init-functions should be sourceable from login shells.

I see it as a helper library for init scripts, not so much a general 
purpose shell library that can be sourced from arbitrary contexts. It 
wasn't really written with that in mind.
To this day, I wasn't actually aware that anyone was using 
/lib/lsb/init-functions outside of an init script context. I don't think 
anyone is actually testing that it works for that.


Regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20220112/2bbe1fc0/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list