diff options
Diffstat (limited to 'v3/glougloud/redis.c')
-rw-r--r-- | v3/glougloud/redis.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/v3/glougloud/redis.c b/v3/glougloud/redis.c index c41c780..8589326 100644 --- a/v3/glougloud/redis.c +++ b/v3/glougloud/redis.c @@ -21,16 +21,20 @@ int redis_init(struct glougloud *ggd) { char redis_conf[4096]; char *echo_args[] = {"echo", redis_conf, NULL}; - char *echo_env[] = {NULL}; char *redis_args[] = {"redis-server", "-", NULL}; - char *redis_env[] = {NULL}; + char newpath[4096]; + char *path; _ggd = ggd; _redis = xcalloc(1, sizeof(struct glougloud_redis)); _redis->pid = fork(); if (_redis->pid > 0) return 0; - droppriv(GLOUGLOUD_USER_PROBES, 1, NULL); + droppriv(GLOUGLOUD_USER_PROBES, 0, NULL); + path = getenv("PATH"); + snprintf(newpath, sizeof(newpath), + "%s:/sbin:/usr/sbin:/usr/local/sbin", path); + setenv("PATH", newpath, 1); snprintf(redis_conf, sizeof(redis_conf), "daemonize no\n" @@ -40,6 +44,8 @@ redis_init(struct glougloud *ggd) { "unixsocketperm 750\n" "timeout 0\n" "loglevel notice\n" + /* XXX for the moment we log in glougloud log + * "logfile /var/log/glougloud/redis.log\n" */ "databases 16\n" "save 900 1\n" "save 300 10\n" @@ -50,8 +56,7 @@ redis_init(struct glougloud *ggd) { "slowlog-log-slower-than 10000\n" "slowlog-max-len 1024\n", _ggd->redis.socket); - exec_pipe("echo", echo_args, echo_env, - "redis-server", redis_args, redis_env); + exec_pipe("echo", echo_args, "redis-server", redis_args); log_warn("error starting redis server"); exit(EXIT_FAILURE); |