我正在运行git-daemon作为windows服务。(使用Create Process)
服务中使用的命令为:
git daemon --reuseaddr --base-path=/data/test_work/ --export-all \
--verbose --enable=receive-pack我在哪里可以看到git daemon的日志
注意:/var/logs上没有文件。
发布于 2015-08-19 22:16:10
如果您仍然需要并想要这样做,我已经找到了一种方法:只需创建一个具有执行权限的bash脚本,并告诉守护进程将其内容记录到一个或两个文件中(如果您希望单独记录stderr ):
#!/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文件为守护进程设置StandardOutPath和StandardErrorPath密钥。
希望它对你也有帮助!
https://stackoverflow.com/questions/24603122
复制相似问题