我正在将 git-daemon 作为 Windows 服务运行。 (使用创建进程)
服务中使用的命令是:
git daemon --reuseaddr --base-path=/data/test_work/ --export-all \
--verbose --enable=receive-pack
我在哪里可以看到日志git daemon
?
注意:没有文件/var/logs
.
如果您仍然需要并且想要这样做,我找到了一种方法:只需创建一个具有执行权限的 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
Where /path/to/git
是 git 命令的路径。我用它launchd
在我的 OS X 机器上,因为我注意到你无法设置StandardOutPath
and StandardErrorPath
使用 .plist 文件的守护程序的密钥。
希望对你也有帮助!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)