When modifying /etc/systemd/system.conf
in CentOS 7, it's crucial to understand how systemd handles configuration changes. This file contains core systemd manager configuration parameters that affect the entire system.
For most changes in system.conf, systemctl daemon-reload
is sufficient to apply modifications. This command:
# Reload systemd manager configuration sudo systemctl daemon-reload
This works for parameters like:
- LogLevel changes
- DefaultTimeoutStartSec/StopSec
- DefaultEnvironment variables
Some specific parameters require a full system reboot to take effect:
# These changes need reboot: [Manager] DefaultLimitNOFILE=100000 DefaultLimitNPROC=50000 CPUAffinity=0,1
Resource limit changes and CPU affinity settings typically require reboot because they affect kernel-level configurations.
To check if your changes took effect without reboot:
# Check current log level systemctl show -p LogLevel # Verify environment variables systemctl show --property=Environment
Recommended workflow for system.conf modifications:
- Make backup:
sudo cp /etc/systemd/system.conf /etc/systemd/system.conf.bak
- Edit configuration file
- Run
sudo systemctl daemon-reload
- Test affected services
- Reboot only if specific parameter requires it
For production systems, consider testing changes in staging first, especially for parameters that might require reboot.
In CentOS 7, systemd reads configurations from multiple locations with /etc/systemd/system.conf being the primary global configuration file. When you modify this file, you're changing system-wide settings that affect all units and the systemd manager itself.
The /etc/systemd/system.conf contains core parameters like:
[Manager] #LogLevel=info #LogTarget=journal-or-kmsg #DefaultTimeoutStartSec=90s #DefaultTimeoutStopSec=90s
These settings control fundamental behaviors of systemd's core process, not individual units.
While systemctl daemon-reload
works well for unit files, it has limitations with system.conf:
# This reloads unit files but not system.conf changes sudo systemctl daemon-reload
The command primarily notifies systemd to re-read unit file definitions, not core configuration.
For changes to take effect in these scenarios:
- Modifications to [Manager] section parameters
- Changes to CPU affinity or memory limits
- Adjustments to watchdog settings
Example needing reboot:
[Manager] DefaultCPUAccounting=yes DefaultMemoryAccounting=yes
You can check if changes were applied without rebooting:
# Check current Manager properties sudo systemctl show --property=DefaultTimeoutStartSec # Compare with your system.conf setting grep DefaultTimeoutStartSec /etc/systemd/system.conf
For testing purposes, you can override settings without modifying system.conf:
# Temporarily set a parameter sudo systemd-analyze set-log-level debug # Verify temporary change systemctl log-level
- Always test changes in staging first
- Document all modifications to system.conf
- Schedule reboots during maintenance windows
- Use
systemd-analyze verify
to check configuration