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 4ad61fd180. Then the default was
changed to `/lib/sysvinit/telinit` in abaaabf40a. Then it
started being  autodetected when meson support was added in 
5c23128dab. This patch restores the behaviour that was 
implemented in configure.ac at the time of its removal.]
This commit is contained in:
Mike Gilbert 2018-01-04 07:14:20 -05:00 committed by Zbigniew Jędrzejewski-Szmek
parent 3046b6db1d
commit 2fa645f1cc
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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',