{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shiny-server/issues/101","labels_url":"https://api.github.com/repos/rstudio/shiny-server/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shiny-server/issues/101/comments","events_url":"https://api.github.com/repos/rstudio/shiny-server/issues/101/events","html_url":"https://github.com/rstudio/shiny-server/issues/101","id":62760784,"number":101,"title":"user_dirs :HOME_USER: setuid/setgid prior to initializing application","user":{"login":"serverhorror","id":36151,"avatar_url":"https://avatars.githubusercontent.com/u/36151?v=3","gravatar_id":"","url":"https://api.github.com/users/serverhorror","html_url":"https://github.com/serverhorror","followers_url":"https://api.github.com/users/serverhorror/followers","following_url":"https://api.github.com/users/serverhorror/following{/other_user}","gists_url":"https://api.github.com/users/serverhorror/gists{/gist_id}","starred_url":"https://api.github.com/users/serverhorror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverhorror/subscriptions","organizations_url":"https://api.github.com/users/serverhorror/orgs","repos_url":"https://api.github.com/users/serverhorror/repos","events_url":"https://api.github.com/users/serverhorror/events{/privacy}","received_events_url":"https://api.github.com/users/serverhorror/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-18T18:01:50Z","updated_at":"2015-08-07T15:12:17Z","closed_at":null,"body":"Hi,\r\n\r\nI'd like to use `user_dirs`, our setup is an NFS and `root_squash` so the current setup doesn't work at all\r\n\r\nFrom the looks it seems like it is creating/opening user log files as root and then chowning. Please drop the privileges to that of the target user before attempting to do anything to the file system.\r\n\r\nI hope the information below is enough for you to see my problem with the way it currently works:\r\n\r\nServer config:\r\n```\r\nserver {\r\n        listen 3838;\r\n        location /users {\r\n          run_as :HOME_USER:;\r\n          user_dirs;\r\n        }\r\n}\r\n```\r\n\r\nLog output:\r\n```\r\n[2015-03-18 18:55:48.595] [INFO] shiny-server - Shiny Server v1.3.0.0 (Node.js v0.10.21)\r\n[2015-03-18 18:55:48.598] [INFO] shiny-server - Using config file \"/etc/shiny-server/shiny-server.conf\"\r\n[2015-03-18 18:55:48.642] [INFO] shiny-server - Starting listener on 0.0.0.0:3838\r\n[2015-03-18 18:55:52.186] [ERROR] shiny-server - Log directory creation failed: ENOENT, no such file or directory '/net/home/marcherm/ShinyApps/log'\r\n[2015-03-18 18:55:52.786] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.\r\n```\r\n\r\nstraced:\r\n```\r\n# strace -tt -e trace=mkdir,setgid,setuid shiny-server\r\n[2015-03-18 18:59:10.376] [INFO] shiny-server - Shiny Server v1.3.0.0 (Node.js v0.10.21)\r\n[2015-03-18 18:59:10.379] [INFO] shiny-server - Using config file \"/etc/shiny-server/shiny-server.conf\"\r\n[2015-03-18 18:59:10.426] [INFO] shiny-server - Starting listener on 0.0.0.0:3838\r\n18:59:12.867821 mkdir(\"/net/home/marcherm/ShinyApps/log\", 0755) = -1 EACCES (Permission denied)\r\n[2015-03-18 18:59:12.869] [ERROR] shiny-server - Log directory creation failed: ENOENT, no such file or directory '/net/home/marcherm/ShinyApps/log'\r\n18:59:13.461572 --- SIGCHLD (Child exited) @ 0 (0) ---\r\n[2015-03-18 18:59:13.466] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/shiny-server/issues/comments/128726761","html_url":"https://github.com/rstudio/shiny-server/issues/101#issuecomment-128726761","issue_url":"https://api.github.com/repos/rstudio/shiny-server/issues/101","id":128726761,"user":{"login":"warnes","id":6144863,"avatar_url":"https://avatars.githubusercontent.com/u/6144863?v=3","gravatar_id":"","url":"https://api.github.com/users/warnes","html_url":"https://github.com/warnes","followers_url":"https://api.github.com/users/warnes/followers","following_url":"https://api.github.com/users/warnes/following{/other_user}","gists_url":"https://api.github.com/users/warnes/gists{/gist_id}","starred_url":"https://api.github.com/users/warnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warnes/subscriptions","organizations_url":"https://api.github.com/users/warnes/orgs","repos_url":"https://api.github.com/users/warnes/repos","events_url":"https://api.github.com/users/warnes/events{/privacy}","received_events_url":"https://api.github.com/users/warnes/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T15:12:17Z","updated_at":"2015-08-07T15:12:17Z","body":"Even if the user marks everything as a+rwX, the log files will end up owned nobody.nobody so the user can't access them."}}