From: Franck Bui Date: Fri, 24 May 2024 12:11:54 +0000 (+0200) Subject: meson: don't put a symlink pointing to '20-systemd-ssh-proxy.conf' in /etc in all... X-Git-Tag: v256-rc4~102^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de0f11d790624138d77f4d383b67c12e0249f54e;p=thirdparty%2Fsystemd.git meson: don't put a symlink pointing to '20-systemd-ssh-proxy.conf' in /etc in all cases On distros like SUSE where ssh config dropins in /usr are supported, there's no need for a symlink in /etc/ssh/ssh_config.d/ that points to the dropin installed somewhere in /usr (that is not reachable by ssh). --- diff --git a/meson.build b/meson.build index dfea903b60e..3eedf9251be 100644 --- a/meson.build +++ b/meson.build @@ -204,6 +204,7 @@ sshconfdir = get_option('sshconfdir') if sshconfdir == '' sshconfdir = sysconfdir / 'ssh/ssh_config.d' endif +conf.set10('LINK_SSH_PROXY_DROPIN', sshconfdir != 'no' and not sshconfdir.startswith('/usr/')) sshdconfdir = get_option('sshdconfdir') if sshdconfdir == '' diff --git a/src/ssh-generator/meson.build b/src/ssh-generator/meson.build index ab01da3c05e..d5413f71ab5 100644 --- a/src/ssh-generator/meson.build +++ b/src/ssh-generator/meson.build @@ -18,10 +18,12 @@ if conf.get('ENABLE_SSH_PROXY_CONFIG') == 1 output : '20-systemd-ssh-proxy.conf', command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], install : true, - install_dir : libexecdir / 'ssh_config.d') + install_dir : sshconfdir.startswith('/usr/') ? sshconfdir : libexecdir / 'ssh_config.d') - install_emptydir(sshconfdir) + if not sshconfdir.startswith('/usr/') + install_emptydir(sshconfdir) - meson.add_install_script(sh, '-c', - ln_s.format(libexecdir / 'ssh_config.d' / '20-systemd-ssh-proxy.conf', sshconfdir / '20-systemd-ssh-proxy.conf')) + meson.add_install_script(sh, '-c', + ln_s.format(libexecdir / 'ssh_config.d' / '20-systemd-ssh-proxy.conf', sshconfdir / '20-systemd-ssh-proxy.conf')) + endif endif diff --git a/tmpfiles.d/20-systemd-ssh-generator.conf.in b/tmpfiles.d/20-systemd-ssh-generator.conf.in index 6d1a6a3e319..dbe354a2d2d 100644 --- a/tmpfiles.d/20-systemd-ssh-generator.conf.in +++ b/tmpfiles.d/20-systemd-ssh-generator.conf.in @@ -7,7 +7,9 @@ # See tmpfiles.d(5) for details +{% if LINK_SSH_PROXY_DROPIN %} L {{SSHCONFDIR}}/20-systemd-ssh-proxy.conf - - - - {{LIBEXECDIR}}/ssh_config.d/20-systemd-ssh-proxy.conf +{% endif %} {% if CREATE_SSHDPRIVSEPDIR %} d {{SSHDPRIVSEPDIR}} 0755 {% endif %}