wownero/src
redfish ce6b83128e daemonizer: posix: keep parent's working dir and umask
Keep the working directory (and umask) inherited from
the parent. Otherwise, it's impossible to control
the working directory of the daemon (from systemd, for
example).

Furthermoer, bitmonerod attempts to create logging directories and files
*in current working directory*. This fails due to permission denied and
generates a (caught, nonfatal) exception. Below is the strace with this
patch applied (so, no `chdir("/")`), showing successful opens at `log/`
relative path. Without this patch they fail (sorry, didn't save the
trace).

```
28911 getcwd("/.../bitmonero", 128) = 25
28911 stat64("/var/lib/bitmonero/.bitmonero", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
28911 stat64("/etc/bitmonerod.conf", {st_mode=S_IFREG|0644, st_size=244, ...}) = 0
28911 open("/etc/bitmonerod.conf", O_RDONLY|O_LARGEFILE) = 3
28911 open("/var/log/bitmonero/bitmonero.log", O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 0666) = 3
28911 stat64("log", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
28911 stat64("log/dbg", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
28911 open("log/dbg/main.log", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 4
```
The reasoning of chdir("/") in order to prevent the daemon from holding
a filesystem in busy state is not compelling at all: the choice of
working directory for the daemon is the user's business not the
daemon's.
2016-07-09 20:16:44 -04:00
..
blockchain_db Merge branch 'performance' of https://github.com/LMDB/bitmonero 2016-04-29 21:41:43 +02:00
blockchain_utilities cn_deserialize: add minergate data 2016-06-06 18:51:36 +01:00
blocks baked-in block headers now go all the way up to 1 million. 1 MILLION 2016-03-16 21:59:21 +02:00
common remove POSIX_C_SOURCE and remove dlfcn.h for static builds 2016-06-21 11:16:25 -05:00
crypto Merge pull request #846 2016-06-19 21:25:52 +02:00
cryptonote_core tx_extra: parse new chunk added by minergate 2016-06-06 18:29:16 +01:00
cryptonote_protocol Revert "Print stack trace upon exceptions" 2016-03-21 10:12:23 +00:00
daemon daemon: print exception errors when failing to parse config file 2016-06-30 22:15:40 +01:00
daemonizer daemonizer: posix: keep parent's working dir and umask 2016-07-09 20:16:44 -04:00
miner Revert "Print stack trace upon exceptions" 2016-03-21 10:12:23 +00:00
mnemonics updated copyright year 2015-12-31 08:39:56 +02:00
p2p allow peers without port 2016-07-03 12:51:12 +01:00
platform updated copyright year 2015-12-31 08:39:56 +02:00
rpc rpc: restrict number of fake outs requested in restricted rpc mode 2016-06-29 20:43:14 +01:00
serialization even more typos 2016-01-25 15:05:29 +01:00
simplewallet Merge pull request #879 2016-07-06 18:15:36 +02:00
wallet wallet2_api: make this build (smatch needs .str() for /=) 2016-07-07 22:42:59 +01:00
CMakeLists.txt remove connectivity tool, comment it out from munin plugins too 2016-03-25 14:52:19 +02:00
cryptonote_config.h Fix V1/V2 use of hard fork related parameters 2016-01-29 17:21:11 +00:00
version.cmake Fix language 2016-03-03 00:34:19 +00:00
version.h.in bumped version number 2016-04-02 12:21:59 +09:00