From: Mike Gilbert Date: Thu, 4 Jan 2018 12:14:20 +0000 (-0500) Subject: meson: don't search PATH for telinit (#7770) X-Git-Tag: v237~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fa645f1ccbbed95868b0f25017533c8de2bba2b;p=thirdparty%2Fsystemd.git meson: don't search PATH for telinit (#7770) On a typical system running systemd, the telinit in PATH is very likely to be a symlink to systemctl. Setting TELINIT to this may result in an infinite recursion if telinit is called and sd_booted() == 0. This may commonly occur in a chroot environment. Bug: https://bugs.gentoo.org/642724 [zj: The path was originally hardcoded as "/lib/upstart/telinit", but was made configurable without changing the default in 4ad61fd1806dde23d2c99043b4bed91a196d2c82. Then the default was changed to `/lib/sysvinit/telinit` in abaaabf40a9891014ed4c402d7beb5a67ac256b1. Then it started being autodetected when meson support was added in 5c23128daba7236a6080383b2a5649033cfef85c. This patch restores the behaviour that was implemented in configure.ac at the time of its removal.] --- diff --git a/meson.build b/meson.build index df66228a878..f95feee99de 100644 --- a/meson.build +++ b/meson.build @@ -503,8 +503,7 @@ splash_bmp = files('test/splash.bmp') # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, # /usr/sbin, /sbin, and fall back to the default from middle column. -progs = [['telinit', '/lib/sysvinit/telinit'], - ['quotaon', '/usr/sbin/quotaon' ], +progs = [['quotaon', '/usr/sbin/quotaon' ], ['quotacheck', '/usr/sbin/quotacheck' ], ['kill', '/usr/bin/kill' ], ['kmod', '/usr/bin/kmod' ], @@ -531,6 +530,8 @@ foreach prog : progs substs.set(name, path) endforeach +conf.set_quoted('TELINIT', get_option('telinit-path')) + if run_command('ln', '--relative', '--help').returncode() != 0 error('ln does not support --relative') endif diff --git a/meson_options.txt b/meson_options.txt index f0c0506ff1b..f71755cfa6c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -29,7 +29,8 @@ option('sysvinit-path', type : 'string', value : '/etc/init.d', description : 'the directory where the SysV init scripts are located') option('sysvrcnd-path', type : 'string', value : '/etc/rc.d', description : 'the base directory for SysV rcN.d directories') -option('telinit-path', type : 'string', description : 'path to telinit') +option('telinit-path', type : 'string', value : '/lib/sysvinit/telinit', + description : 'path to telinit') option('rc-local', type : 'string', value : '/etc/rc.local') option('halt-local', type : 'string',