Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For the same reason as in coreos#39 (copying the phrasing below): With the `staged` file shared, there would be potential for two or more processes executing `motdgen` to write to it resulting in corrupted output, or the error in the `cat` command due to missing file reported in coreos#35 (comment). Currently, this is not a problem with motdgen, but could be if `motdgen` were invoked by something like the udev rules that invoke `issuegen`. Instead, write the intermediate output to a variable before writing to the final output file. This ensures only valid output is written to the issue file shown to the terminal. Additionally, perform code tidyups similar to those done for `issuegen` in coreos#40.
- Loading branch information