首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >git-daemon的日志保存在哪里?(使用Cygwin的windows上的Git)

git-daemon的日志保存在哪里?(使用Cygwin的windows上的Git)
EN

Stack Overflow用户
提问于 2014-07-07 12:37:25
回答 1查看 1.9K关注 0票数 4

我正在运行git-daemon作为windows服务。(使用Create Process)

服务中使用的命令为:

代码语言:javascript
复制
git daemon --reuseaddr --base-path=/data/test_work/ --export-all \
    --verbose --enable=receive-pack

我在哪里可以看到git daemon的日志

注意:/var/logs上没有文件。

EN

回答 1

Stack Overflow用户

发布于 2015-08-19 22:16:10

如果您仍然需要并想要这样做,我已经找到了一种方法:只需创建一个具有执行权限的bash脚本,并告诉守护进程将其内容记录到一个或两个文件中(如果您希望单独记录stderr ):

代码语言:javascript
复制
#!/bin/bash

# Git daemon launchd startup command.

GIT_RO_USER="git-ro" # The user which has read only access to the repositories.

GIT_REP_BASE_PATH="/path/to/GitRepositories" # The repositories base path.

GIT_LOG_FILE="/var/log/git.log" # The git daemon log file. The user which runs the script must have the right write permissions

/path/to/git daemon --reuseaddr --verbose --user=$GIT_RO_USER --base-path=$GIT_REP_BASE_PATH $GIT_REP_BASE_PATH >> $GIT_LOG_FILE 2>&1

# Or if you like to keep the error log separated, uncomment the following lines and comment the previous one:
#GIT_ERR_LOG_FILE="/var/log/git_err.log" # The error log file
#/path/to/git daemon --reuseaddr --verbose --user=$GIT_RO_USER --base-path=$GIT_REP_BASE_PATH $GIT_REP_BASE_PATH >> $GIT_LOG_FILE 2>> $GIT_ERR_LOG_FILE

其中/path/to/git是git命令的路径。我在我的OS机器上将它与launchd一起使用,因为我注意到您不能使用.plist文件为守护进程设置StandardOutPathStandardErrorPath密钥。

希望它对你也有帮助!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24603122

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档