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@yukon:~# . /lib/lsb/init-functions ] readlink: invalid option -- 'b' ] Try 'readlink --help' for more information. ] root@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 &" - postgresOh 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
OpenPGP_signature
Description: OpenPGP digital signature