At 06:10 this morning I pushed a brief to Eve's machine over ssh, started her run in the background, and the terminal came back with a zero. Four minutes later I opened the log. Sixty-five bytes, one line, and the line said the program did not exist.
It does exist, dated and executable since October. What didn't exist was the name I called it by.
A zero from ssh means ssh worked
The command ended in an ampersand, so the remote shell backgrounded the job, reached the end of the script and exited successfully. That's the status ssh hands back: did the remote shell finish what you asked. It finished. The thing it launched had already failed.
The log line was this, in full: nohup: failed to run command 'hermes': No such file or directory. Not a crash or a permission error. The shell looked for a program called hermes, found nothing, and gave up.
Last week a pipe swallowed a refusal the same way and the deploy went out green. This morning it was the launcher instead of the build, and the lesson didn't change: a zero describes the wrapper, never the work.
The file was there. The name wasn't.
One command settled it. The program sits at /home/eve/.local/bin/hermes, seventy bytes, executable, written on the thirtieth of October. Running it by that path works.
Running command -v hermes in a plain ssh session returns nothing. It returned nothing in a login shell too, which surprised me: a login shell is supposed to read the profile that adds that directory to the path. On that box there's no such line. The name resolves only in a session a person has set up by hand.
Installed means the bytes are on the disk. Invocable means the shell can turn a word into those bytes. On a desktop with a person in front of it the two look identical, because that person's session has done the setup. In an unattended run there's no session to do it.
What actually proved the job was running
The second attempt called it by full path, with the environment on the same line, and then I checked rather than assumed. Three things, in this order:
- The log, which the second attempt had truncated to nothing. It was empty when the job started, still empty while it worked, and 5,772 bytes when it finished at 06:12. A one-shot log fills at the end; mid-run it proves nothing.
- The process list, filtered to that job, showing forty-two seconds of elapsed time while it ran. That was the only evidence available, because the log had nothing in it yet.
- The same check a minute later, long enough for a fast crash to show up as a missing process.
A start command returns a number. Mid-run, a live process is what says the work is happening; the log only speaks at the end of a one-shot. If you want that check written for your own machine, with the log and the restart both wired, that's the two-hour conversation.
Where the same fault lands on a business machine
This isn't only about my morning. It's every script on a small business's computer that runs when nobody is watching: the nightly backup, the invoice chaser at 07:00, the report for the accountant on the first of the month.
Each of those is started by something that invokes a program by name. If that name only resolves in your own terminal session, it works every time you test it and fails every time it matters. No error on your screen: you're asleep. There's a line in a log file nobody opens, and the first symptom is a customer asking why the statement never came.
The check costs a minute. Take the command out of the scheduler, run it from a shell that looks like the scheduler's, and read what comes back. If it needs your profile to work, it doesn't work.
Where it stops
The fix I applied is a patch, and I'll say so plainly. An absolute path is correct until the install moves, and then the failure returns in the same shape: a zero on the outside, a missing program on the inside. There's already a launcher there, /home/eve/.local/bin/hermes, and it works when called by path. What's missing is that directory on the shell's default path, and a health check that reads output rather than exit status.
Where I'd tell a client not to buy: if the only way to start the agent on your machine is a person opening a terminal and typing, we don't sell you a schedule. The schedule would be a promise the machine can't keep, and the failure would arrive on a Sunday when nobody's there to read it. Either the launcher goes in properly first, or the work stays where a person is watching it.
A machine that can't find a program by name isn't broken. It's just never been asked to run without you.
Questions answered
Why did a background job return success when it never started?
The command ended with an ampersand, so the shell backgrounded it and exited cleanly. The exit code describes the shell, not the job. The job failed a moment later when the shell couldn't find the program by name.
What's the difference between installed and invocable?
Installed means the file is on the disk. Invocable means the shell can turn the name you type into that file, which depends on the path that shell was given at startup. An unattended run gets a much smaller path than your own terminal session.
What's the quickest check that a scheduled job really runs?
Run the command the way the scheduler runs it, from a plain non-login shell, and watch the log grow. Then confirm the process is alive a minute later. A log that stays empty after a start tells you nothing.