Browse Source

Add option to specific PAM limits.d directory

Kira Bruneau 2 years ago
parent
commit
55b799e3df
3 changed files with 10 additions and 1 deletions
  1. 1 1
      data/meson.build
  2. 8 0
      meson.build
  3. 1 0
      meson_options.txt

+ 1 - 1
data/meson.build

@@ -41,7 +41,7 @@ if with_pam_renicing
       input: 'pam_limits/10-gamemode.conf.in',
       output: '10-gamemode.conf',
       configuration: data_conf,
-      install_dir: '/etc/security/limits.d',
+      install_dir: path_pam_limits_dir,
   )
 endif
 

+ 8 - 0
meson.build

@@ -132,6 +132,9 @@ endif
 
 if with_privileged_group != ''
   with_pam_renicing = get_option('with-pam-renicing')
+  if with_pam_renicing
+    path_pam_limits_dir = get_option('with-pam-limits-dir')
+  endif
 else
   with_pam_renicing = false
 endif
@@ -209,6 +212,11 @@ report = [
     '    includedir:                             @0@'.format(path_includedir),
 ]
 
+if with_pam_renicing
+report += [
+    '    PAM limits.d directory:                 @0@'.format(path_pam_limits_dir),
+]
+endif
 if sd_bus_provider == 'systemd'
 if with_systemd_unit
 report += [

+ 1 - 0
meson_options.txt

@@ -1,5 +1,6 @@
 # limits.d
 option('with-pam-renicing', type: 'boolean', description: 'Install the limits.d configuration file to allow renicing as a user being part of the privileged gamemode group', value: 'true')
+option('with-pam-limits-dir', type: 'string', description: 'Explicitly set the PAM limits.d directory', value: '/etc/security/limits.d')
 
 # sd-bus provider
 option('with-sd-bus-provider', type: 'combo', choices: ['systemd', 'elogind', 'no-daemon'], value: 'systemd')