Skip to content

Commit dea7bd5

Browse files
Merge pull request #25 from step-security/feature-23
Add service log to post step
2 parents f4e7a3e + eaf0ca8 commit dea7bd5

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

dist/post/index.js

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cleanup.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as fs from "fs";
2+
import * as cp from "child_process";
23

34
(async () => {
45
if (process.platform !== "linux") {
@@ -38,6 +39,14 @@ import * as fs from "fs";
3839
var content = fs.readFileSync(status, "utf-8");
3940
console.log(content);
4041
}
42+
43+
if (!fs.existsSync(doneFile)) {
44+
var journalLog = cp.execSync("sudo journalctl -u agent.service", {
45+
encoding: "utf8",
46+
});
47+
console.log("Service log:");
48+
console.log(journalLog);
49+
}
4150
})();
4251

4352
function sleep(ms) {

0 commit comments

Comments
 (0)