Challenge, Easy,  on  Linux

Troubleshoot a Log Shipping Daemon That Refuses to Start

A log-shipping service called logshipd has been deployed on this server. Unfortunately, every time it's launched, it crashes almost immediately:

logshipd v2.3.1: starting...
logshipd v2.3.1: fatal: subsystem initialization failed (code -1)

The error message is useless - it confirms the daemon failed, but gives no clue about why. The source code is not available, so you cannot simply read the implementation to track down the problem.

Your task: diagnose the root cause of the failure and fix it, then start logshipd and keep it running for at least 10 seconds.

Hint 1

A program's error output is written by the program's author. It can be vague, misleading, or simply incomplete. But regardless of what the program says, what it actually does is recorded at the kernel level through system calls (syscalls) - the primitive operations every process uses to interact with the OS: opening files, binding to ports, allocating memory, spawning children, and so on.

Linux provides tools to intercept and log these system calls as they happen. Attaching such a tool to a failing program often reveals the true root cause even when the error message gives you nothing to work with.

Hint 2

The strace tool intercepts and records every system call a process makes, along with each call's arguments and return value.

Using strace is as simple as running strace <program> - it will start the program under strace's control and write all system calls it makes to the terminal.

Hint 3

The output of a strace session can be overwhelming. Try to focus on lines that end with = -1 - those often indicate failed system calls. The errno name next to it tells you why. For example, ENOENT means the target path doesn't exist, EACCES means a permission was denied, and so on.