Follow conventional practice of other RPC service daemons.

Signed-off-by: Chuck Lever <[email protected]>
---

 src/fedfsd/main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/fedfsd/main.c b/src/fedfsd/main.c
index f0a39d6..fd6bee5 100644
--- a/src/fedfsd/main.c
+++ b/src/fedfsd/main.c
@@ -219,6 +219,10 @@ int main(int argc, char **argv)
                exit(EXIT_FAILURE);
 
        if (!foreground) {
+               if (chdir(FEDFS_DEFAULT_STATEDIR) == -1) {
+                       xlog(L_ERROR, "chdir: %m");
+                       exit(EXIT_FAILURE);
+               }
                if (daemon(0, 0) == -1) {
                        xlog(L_ERROR, "daemon: %m");
                        exit(EXIT_FAILURE);


_______________________________________________
fedfs-utils-devel mailing list
[email protected]
https://oss.oracle.com/mailman/listinfo/fedfs-utils-devel

Reply via email to