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

improve verbosity

parent ed1eaa0d
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@
#include <66/service.h>
#include <66/write.h>
/* dst e.g. /var/lib/66/system/<tree>/servicedirs/svc/<name> */
/* dst e.g. /var/lib/66/system/service/svc/<name> */
void write_classic(resolve_service_t *res, char const *dst)
{
......
......@@ -37,9 +37,11 @@ void write_common(resolve_service_t *res, char const *dst)
log_flow() ;
/** down file */
if (res->execute.down)
if (res->execute.down) {
log_trace("create file: ", dst, "/down") ;
if (!file_create_empty(dst, "down", 0644))
log_dieusys(LOG_EXIT_SYS, "create down file") ;
}
/** notification-fd */
if (res->notify)
......@@ -125,6 +127,7 @@ void write_common(resolve_service_t *res, char const *dst)
}
}
log_trace("copy: ", tmp, " to: ", dst) ;
if (!hiercopy(tmp, dst))
log_dieusys(LOG_EXIT_SYS, "copy: ", tmp, " to: ", dst) ;
}
......
......@@ -35,6 +35,7 @@ void write_execute_scripts(char const *file, char const *contents, char const *d
char run[strlen(contents) + 1] ;
auto_strings(run, contents) ;
log_trace("create file: ", dst, "/", file) ;
if (!file_write_unsafe(dst, file, run, FAKELEN))
log_dieusys(LOG_EXIT_SYS, "write: ", dst, "/", file) ;
......
......@@ -38,7 +38,7 @@
#define FAKELEN strlen(run)
#endif
/** @destination -> /var/lib/66/system/<tree>/servicedirs/svc/ */
/** @destination -> /var/lib/66/system/service/svc/<name> */
void write_logger(resolve_service_t *res, char const *destination)
{
......@@ -76,6 +76,7 @@ void write_logger(resolve_service_t *res, char const *destination)
char write[strlen(destination) + 10] ;
/** run script */
log_trace("create file: ", destination, "/run") ;
if (!file_write_unsafe(destination, "run", res->sa.s + res->execute.run.run, strlen(res->sa.s + res->execute.run.run)))
log_dieusys(LOG_EXIT_SYS, "write: ", destination, "/run.user") ;
......@@ -85,6 +86,7 @@ void write_logger(resolve_service_t *res, char const *destination)
log_dieusys(LOG_EXIT_SYS, "chmod", write) ;
/** run.user script */
log_trace("create 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)))
log_dieusys(LOG_EXIT_SYS, "write: ", destination, "/run.user") ;
......
......@@ -45,18 +45,6 @@ void write_services(resolve_service_t *res, char const *workdir)
if (logname > 0)
type = 4 ;
/**
*
*
* please pass through a temporary or backup
*
* just need to switch the /run/66/state/0/<service> symlink
* with atomic_symlink
*
*
*
* */
log_trace("write service ", name) ;
switch(type) {
......
......@@ -26,6 +26,7 @@ void write_uint(char const *dst, char const *name, uint32_t ui)
char number[UINT32_FMT] ;
log_trace("write file: ", dst, "/", name) ;
if (!file_write_unsafe(dst, name, number, uint32_fmt(number,ui)))
log_dieusys(LOG_EXIT_SYS, "write: ", dst, "/", name) ;
}
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