浏览代码

Merge pull request #5496 from unclejack/check_if_root

check if the daemon is run as root on startup
Guillaume J. Charmes 11 年之前
父节点
当前提交
5f301191cf
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      docker/docker.go

+ 4 - 0
docker/docker.go

@@ -98,6 +98,10 @@ func main() {
 	}
 
 	if *flDaemon {
+		if os.Geteuid() != 0 {
+			log.Fatalf("The Docker daemon needs to be run as root")
+		}
+
 		if flag.NArg() != 0 {
 			flag.Usage()
 			return