mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-31 03:56:42 +00:00
When starting scylla daemon as non-root the initialization fails because standard /var/lib/scylla is not accessible by regular users. Making the default dir accessible for user is not very convenient either, as it will cause conflicts if two or more instances of scylla are in use. This problem can be resolved by specifying --commitlog-directory, --data-file-directories, etc on start, but it's too much typing. I propose to revive Nadav's --home option that allows to move all the directories under the same prefix in one go. Unlike Nadav's approach the --workdir option doesn't do any tricky manipulations with existing directories. Insead, as Pekka suggested, the individual directories are placed under the workir if and only if the respective option is NOT provided. Otherwise the directory configuration is taken as is regardless of whether its absolute or relative path. The values substutution is done early on start. Avi suggested that this is unsafe wrt HUP config re-read and proper paths must be resolved on the fly, but this patch doesn't address that yet, here's why. First of all, the respective options are MustRestart now and the substitution is done before HUP handler is installed. Next, commitlog and data_file values are copied on start, so marking the options as LiveUpdate won't make any effect. Finally, the existing named_value::operator() returns a reference, so returning a calculated (and thus temporary) value is not possible (from my current understanding, correct me if I'm wrong). Thus if we want the *_directory() to return calculated value all callers of them must be patched to call something different (e.g. *_directory.get() ?) which will lead to more confusion and errors. Changes v3: - the option is --workdir back again - the existing *directory are only affected if unset - default config doesn't have any of these set - added the short -W alias Changes v2: - the option is --home now - all other paths are changed to be relative Signed-off-by: Pavel Emelyanov <xemul@scylladb.com> Message-Id: <20191119130059.18066-1-xemul@scylladb.com>