/var/run is cleared on boot, store user-data in /etc instead
This commit is contained in:
parent
5de42d6464
commit
8c4f6a384b
1 changed files with 3 additions and 3 deletions
|
@ -635,7 +635,7 @@ agent_userdata(const unsigned char *userdata, size_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write user-data script into file */
|
/* write user-data script into file */
|
||||||
file = "/var/run/user-data";
|
file = "/etc/rc.user-data";
|
||||||
if (fileout(str, "w", file) != 0) {
|
if (fileout(str, "w", file) != 0) {
|
||||||
log_warnx("failed to write user-data");
|
log_warnx("failed to write user-data");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -643,8 +643,8 @@ agent_userdata(const unsigned char *userdata, size_t len)
|
||||||
|
|
||||||
/* and call it from rc.firsttime later on boot */
|
/* and call it from rc.firsttime later on boot */
|
||||||
if (asprintf(&line,
|
if (asprintf(&line,
|
||||||
"logger -s -t cloud-agent \"running %s\"\n"
|
"logger -s -t cloud-agent \"running user-data\"\n"
|
||||||
"%s %s\nrm %s\n", file, shebang + 2, file, file) == -1 ||
|
"%s %s\nrm %s\n", shebang + 2, file, file) == -1 ||
|
||||||
fileout(line, "a", "/etc/rc.firsttime") != 0)
|
fileout(line, "a", "/etc/rc.firsttime") != 0)
|
||||||
log_warnx("failed to add user-data script");
|
log_warnx("failed to add user-data script");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue