[PKG-OpenRC-Debian] about 0035-consider-initd-shebangs.patch
heroxbd at gentoo.org
heroxbd at gentoo.org
Thu Apr 24 12:32:45 UTC 2014
Dear Gabriele,
Supporting shebang other than /bin/sh is needed for Debian. But
0035-consider-initd-shebangs.patch feels a bit too hackish to me.
how about this?
- . "${RC_SERVICE}"
+ read -r shebang < "${RC_SERVICE}"
+ case "${shebang}" in
+ *runscript*|*openrc-run*)
+ . "${RC_SERVICE}"
+ ;;
+ *)
+ exec "${RC_SERVICE}" $*
+ ;;
+ esac
It uses POSIX shell builtin commands to handle shebangs, and avoids the
extra exported variable.
Could you please test this on your motivating init script? I tested it
against nfs-common with "#!/bin/bash" shebang. It'll be cool if we can
come up with a nice unit test for this.
Cheers,
Benda
More information about the OpenRC-devel
mailing list