diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-27 23:51:03 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-27 23:51:03 +0200 |
| commit | baed8bf5fd429305685cc180184e99094cd64339 (patch) | |
| tree | 5a00862b6757a6442c03dc92b70cae902498c6de | |
| parent | 13f302149a2a2846d801689e3d194af3249ed0b7 (diff) | |
Writer on macOS runs as root, so trying to use the config_path()v2.15.63
to log to will end up trying to write to root's home. Instead,
log to stdout as the process control stuff redirects that into
/var/log anyway.
| -rw-r--r-- | src/lib/wscript | 1 | ||||
| -rw-r--r-- | src/tools/dcpomatic_disk_writer.cc | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/wscript b/src/lib/wscript index 802020527..1eac718e3 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -165,6 +165,7 @@ sources = """ transcode_job.cc types.cc signal_manager.cc + stdout_log.cc update_checker.cc upload_job.cc uploader.cc diff --git a/src/tools/dcpomatic_disk_writer.cc b/src/tools/dcpomatic_disk_writer.cc index c38e35e3e..e63a7a7a9 100644 --- a/src/tools/dcpomatic_disk_writer.cc +++ b/src/tools/dcpomatic_disk_writer.cc @@ -42,6 +42,7 @@ extern "C" { #endif #ifdef DCPOMATIC_OSX +#include "lib/stdout_log.h" #undef nil extern "C" { #include <lwext4/file_dev.h> @@ -504,11 +505,20 @@ try int main () { +#ifdef DCPOMATIC_OSX + /* On macOS this is running as root, so config_path() will be somewhere in root's + * home. Instead, just write to stdout as the macOS process control stuff will + * redirect this to a file in /var/log + */ + dcpomatic_log.reset(new StdoutLog(LogEntry::TYPE_DISK)); + LOG_DISK_NC("dcpomatic_disk_writer started"); +#else /* XXX: this is a hack, but I expect we'll need logs and I'm not sure if there's * a better place to put them. */ dcpomatic_log.reset(new FileLog(config_path() / "disk_writer.log", LogEntry::TYPE_DISK)); LOG_DISK_NC("dcpomatic_disk_writer started"); +#endif try { nanomsg = new Nanomsg (false); |
