Project

General

Profile

Actions

Bug #16882

closed

Generic method sysctl_value

Added by Nicolas CHARLES over 4 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
Generic methods
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
Reviewed
Fix check:
Checked
Regression:

Description

creating a Generic Method to manage sysctl values, that would be call sysctl_value, and take 3 parameters:
  • the key
  • the value,
  • the file name where to put the value in /etc/sysctl.d

It would check the keys/value running sysctl -n key, and:
If it success, with the correct value, report a Success (wherever the key is defined)
If its an error, it would add it in the file given as a parameter (creating it if necessary), run sysctl -p, and report a Repaired status

If the key exists, with the incorrect value, it would
  1. create the correct key/value in the file given as a parameter
  2. run sysctl -p
  3. run sysctl -n to check if the value is set or not (given the precedence of files, it may not be used)
    report based on the return of sysctl -n

Related issues 1 (0 open1 closed)

Has duplicate Rudder - User story #9706: Method to set sysctl settingsRejectedActions
Actions

Also available in: Atom PDF