Skip to content
Snippets Groups Projects
Commit 0545d30a authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

typo fix and memories

parent 23d4c3bf
No related branches found
No related tags found
No related merge requests found
......@@ -111,10 +111,10 @@ int write_common(resolve_service_t *res, char const *dst)
int fd ;
size_t wlen = strlen(what) ;
char tmp[SS_MAX_PATH_LEN + 1] ;
char dest[dstlen + 1 + wlen + 1];
char dest[dstlen + 1 + wlen + 1] ;
char basename[SS_MAX_PATH_LEN + 1] ;
if (what [0] == '/' ) {
if (what[0] == '/' ) {
auto_strings(tmp, what) ;
......@@ -184,7 +184,5 @@ int write_common(resolve_service_t *res, char const *dst)
stralloc_free(&sa) ;
}
return 1 ;
}
......@@ -39,7 +39,7 @@ int write_execute_scripts(char const *file, char const *contents, char const *ds
char run[strlen(contents) + 1] ;
auto_strings(run, contents) ;
log_trace("create file: ", dst, "/", file) ;
log_trace("write file: ", dst, "/", file) ;
if (!file_write_unsafe(dst, file, run, FAKELEN))
log_warnusys_return(LOG_EXIT_ZERO, "write: ", dst, "/", file) ;
......
......@@ -77,7 +77,13 @@ void write_logger(resolve_service_t *res, char const *destination, uint8_t force
parse_cleanup(res, destination, force) ;
log_dieusys(LOG_EXIT_SYS, "create directory: ", res->sa.s + res->logger.destination) ;
}
/**
* ISSUE: In case of e.g. earlier service the log
* may point to a tmpfs directory. At next reboot
* the log directory will not be present. We just
* react as oneshot service making it at .run file
* with execl-toc.
*/
if (!owner && ((res->execute.run.build == BUILD_AUTO) || (!res->execute.run.build))) {
if (!youruid(&log_uid, logrunner) || !yourgid(&log_gid, log_uid)) {
......@@ -93,7 +99,7 @@ void write_logger(resolve_service_t *res, char const *destination, uint8_t force
char write[strlen(destination) + 10] ;
/** run script */
log_trace("create file: ", destination, "/run") ;
log_trace("write file: ", destination, "/run") ;
if (!file_write_unsafe(destination, "run", res->sa.s + res->execute.run.run, strlen(res->sa.s + res->execute.run.run))) {
parse_cleanup(res, destination, force) ;
log_dieusys(LOG_EXIT_SYS, "write: ", destination, "/run.user") ;
......@@ -107,7 +113,7 @@ void write_logger(resolve_service_t *res, char const *destination, uint8_t force
}
/** run.user script */
log_trace("create file: ", destination, "/run.user") ;
log_trace("write file: ", destination, "/run.user") ;
if (!file_write_unsafe(destination, "run.user", res->sa.s + res->execute.run.run_user, strlen(res->sa.s + res->execute.run.run_user))) {
parse_cleanup(res, destination, force) ;
log_dieusys(LOG_EXIT_SYS, "write: ", destination, "/run.user") ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment