What the rsyslog Error Means
An rsyslog error in Linux indicates a failure in the system logging daemon. This can manifest as:
- The
rsyslogservice is not running or crashes immediately after starting - System messages are not being written to files (
/var/log/syslog,/var/log/messages) - Logs are either missing or contain only old entries
- The output of
systemctl status rsyslogshows afailedorinactivestate
A typical message in systemd logs:
● rsyslog.service - System Logging Service
Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2026-02-16 10:30:00 MSK; 1min 30s ago
Common Causes
- Service not running — rsyslog is disabled or not enabled for autostart.
- Configuration errors — syntax error in
/etc/rsyslog.confor files in/etc/rsyslog.d/. - Insufficient permissions — the
syslog(orroot) user cannot write to the/var/logdirectory. - Port conflict — another process is already using port 514 (UDP/TCP), which rsyslog requires.
- Corrupted modules — broken or incompatible modules in
/etc/rsyslog.d/or/usr/lib/rsyslog/. - Insufficient disk space — the partition containing
/var/logis 100% full. - SELinux/AppArmor issues — security policies are blocking writes.
Method 1: Check and Restart the Service
Most often, the problem is solved by simply restarting the service.
- Check the current status:
systemctl status rsyslog
- If the service is not active, try to start it:
sudo systemctl start rsyslog
- Enable autostart (if not already enabled):
sudo systemctl enable rsyslog
- After starting, verify the service is running:
systemctl is-active rsyslog && echo "Rsyslog is running" || echo "Rsyslog is not running"
- Send a test message and ensure it appears in the logs:
logger "Test message from FixPedia"
tail -f /var/log/syslog | grep "Test message"
Method 2: Check Configuration Syntax
Incorrect syntax in configuration files is a frequent cause of rsyslog failures.
- Validate the configuration without restarting:
sudo rsyslogd -N1
If the output contains error or invalid, it means there are issues.
- Check the main configs:
# Main config
sudo rsyslogd -N1 -f /etc/rsyslog.conf
# All files in /etc/rsyslog.d/
for f in /etc/rsyslog.d/*.conf; do
echo "Checking $f"
sudo rsyslogd -N1 -f "$f" || echo "Error in $f"
done
- If you find an error, fix the file. Common issues:
- Extra or missing quotes
- Incorrect directive syntax (e.g.,
*.*instead of*.*;) - Typos in module names (e.g.,
imtcpinstead ofimtcp)
- After corrections, re-check the syntax and restart:
sudo systemctl restart rsyslog
Method 3: Check Permissions and Disk Space
Rsyslog must be able to write to the log directory.
- Check permissions on
/var/log:
ls -ld /var/log
Expected output: drwxr-xr-x with owner root. Log subdirectories should be writable by the syslog user.
- Verify the
sysloguser exists:
id syslog
If the user is missing, reinstall the rsyslog package.
- Check disk space:
df -h /var/log
If the partition is 100% full, clean up old logs or increase the partition size.
- Check log file ownership:
ls -l /var/log/syslog /var/log/messages
The owner should be syslog or root. If not, correct it:
sudo chown syslog:adm /var/log/syslog
sudo chmod 640 /var/log/syslog
Method 4: Restore Default Configuration
If the configuration is severely corrupted, it's easier to restore the original files.
- Debian/Ubuntu:
sudo apt-get install --reinstall rsyslog
This restores files from the package. The /etc/rsyslog.conf config will be replaced, but files in /etc/rsyslog.d/ will remain.
- RHEL/CentOS/Fedora:
sudo yum reinstall rsyslog
# Or for newer versions:
sudo dnf reinstall rsyslog
- After reinstalling, check the configuration (Method 2) and restart the service.
- If you had custom settings, compare the new config with an old backup (if available) and migrate only the necessary changes.
Method 5: Diagnostics via journalctl
Systemd stores logs for all services, including rsyslog, even if it's not running.
- View rsyslog logs directly:
sudo journalctl -u rsyslog --no-pager -n 50
- Search for specific errors:
sudo journalctl -u rsyslog | grep -i "error\|failed\|invalid"
- If rsyslog fails to start due to a module, you'll see something like:
rsyslogd: could not load module 'imtcp', errors: 1
In this case, check if the required module is installed:
dpkg -l | grep rsyslog # Debian/Ubuntu
rpm -qa | grep rsyslog # RHEL/CentOS
- If the issue is port 514, check if it's already in use:
sudo ss -tulpn | grep :514
If the port is occupied by another process, stop it or change rsyslog's port in the config.
Prevention
To avoid recurring errors:
- Test configurations before applying — always run
rsyslogd -N1after editing configs. - Make backups — save original configs:
sudo cp /etc/rsyslog.conf /etc/rsyslog.conf.backup. - Monitor logs — set up alerts for service failures (e.g., via systemd
Restart=on-failurein the unit file). - Update cautiously — after updating rsyslog, check configuration compatibility (syntax may change).
- Enable only necessary modules — don't load modules you don't use, especially experimental ones.
- Regularly check disk space — ensure log rotation is configured via
logrotate(usually enabled by default).