]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: don't search PATH for telinit (#7770)
authorMike Gilbert <floppymaster@gmail.com>
Thu, 4 Jan 2018 12:14:20 +0000 (07:14 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 4 Jan 2018 12:14:20 +0000 (13:14 +0100)
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.]

meson.build
meson_options.txt

index df66228a8787f3e26e1890738e0be39cebfd3f43..f95feee99de179e23f88680d5b8cfd945c0974c2 100644 (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
index f0c0506ff1b994652826eae3dacd32e27375a936..f71755cfa6ceb02c5eec8434e438dc6c956eaac0 100644 (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',