A lightweight C-based Linux CLI tool to rescue your systemd logs before they rescue you.
OPS is a fast, secure, and minimal Linux CLI utility written in C, designed for system administrators who just want their journalctl logs — quickly, safely, and without drama.
Whether you want to view logs directly in the terminal or save them to a file for later analysis, OPS has your back.
Because sometimes the system breaks… and you just whisper: Oh please, save-me.
- ⚡ Written in C
- High performance with near-zero overhead
- 🔍 Live View
- Display logs for any systemd service directly in your terminal
- 💾 Export Mode
- Save logs to a local file using the
-sflag
- Save logs to a local file using the
- 🔐 Hardened Security
- Strict validation: service names must be alphanumeric (including
.,-,_) - Safe bounds: service names limited to 128 characters to prevent buffer overflows
- Strict validation: service names must be alphanumeric (including
- 🧵 Robust Process Handling
- Uses
fork()andexecvp()instead of unsafesystem()calls
- Uses
- 🌍 Global Access
- Installs to
/usr/local/binfor system-wide availability
- Installs to
Install OPS globally with a single command:
curl -fsSL https://raw.githubusercontent.com/49mg/ops/main/install.sh | bashThis will automatically clone, compile, and install the ops binary.
ops nginxDisplays logs for the nginx systemd service.
ops nginx -sLogs will be saved in your current directory as:
nginx.log
With permissions set to 0644.
OPS implements multiple layers of protection:
-
Input Sanitization
- Rejects any input containing
/,\, or shell redirection characters
- Rejects any input containing
-
Privilege Separation
- Uses
fork()to isolatejournalctlexecution
- Uses
-
Standard File Permissions
- Owner: Read / Write
- Group & Others: Read-only
-
No External Dependencies
- Relies only on standard C libraries and
systemd
- Relies only on standard C libraries and
ops/
├── main.c # Argument parsing with getopt
├── utils.c # Security validation & process logic
├── utils.h # Function prototypes
├── Makefile # Automated build system
├── install.sh # Automated remote installer
└── README.md # Documentation
-
Linux system with:
systemd(journalctl)gccmake
This project is licensed under the MIT License.
Built for sysadmins who’ve said “oh please…” one too many times. 😄