Urgent.News

What's breaking now, across thousands of outlets.

Tech

Five Linux Habits That Make Servers Easier to Trust

1. Production failures often start with a small assumption A command can succeed and still leave a system in a fragile state. The most common examples aren’t exotic bugs; they’re changes that were made without checking what else depends on them. Permissions: fix the path, not everything around it A web process can’t read an uploaded file, so someone runs chmod -R 777 on the application directory.…

Five Linux Habits That Make Servers Easier to Trust

Production failures often start with a small assumption. A command may appear to succeed, yet leave a system in a fragile state. The most common issues are not exotic bugs, but changes made without considering their impact on dependent components. Permissions should be set precisely, rather than broadly. For example, if a web process cannot read an uploaded file, running chmod -R 777 on the application directory resolves the immediate error but grants unauthorized access to modify protected files.

When troubleshooting issues, verify both the system's runtime state and its boot configuration. While systemctl status offers a useful summary, a green state is only one indicator of health. Always check the actual endpoint or job the service is intended to provide. Before modifying a service unit, create a backup of the current configuration and know how to restore it.

After making changes, ensure systemd recognizes the update by reloading and restarting the service: sudo systemctl daemon-reload, sudo systemctl restart example.service, and sudo systemctl status example.service.

Disk space and inodes are critical to monitor. A server may show ample free space but fail to create files if inodes have been exhausted. Conversely, a large log file can consume available space without impacting the application itself. When writes begin failing, inspect both available disk space (`df -h`) and inodes (`df -i`). If storage is limited, identify the affected filesystem and address the issue before deleting any data.

Remember that removing an open log file may not immediately release its space until the process closes it. Implement log rotation and retention policies and set up alerts to notify before the disk reaches a critical level where essential services like databases or package managers can no longer write.

Configuration changes should be straightforward to rollback. Instead of manually editing configuration files, use version control or create a backup before making any risky edits. Validate the syntax of your changes where supported and reload the service rather than restarting it when possible. Maintain an active administrative session while adjusting remote access or networking settings, and confirm that a second connection works before closing the session.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Sunday 11 October →