Forgejo pid 文件(/var/run/forgejo.pid):在 Truenas Core(FreeBSD Jail)中不可读

Forgejo pid 文件(/var/run/forgejo.pid):在 Truenas Core(FreeBSD Jail)中不可读

我已经尝试让 Forgejo 在 Truenas Core(FreeBSD 监狱)中运行一个多星期了。当我以 git 用户身份手动启动 Forgejo 时,它按预期运行,但是尝试让它使用 ports 包提供的包含的 rc 文件运行时,它会出错。

福尔赫霍港 rc.d 脚本

当我手动启动 forgejo 时,它会运行:

root@Forgejo:/home/jailuser # su git
git@Forgejo:/home/jailuser $ forgejo web -c /usr/local/etc/forgejo/conf/app.ini
2024/04/23 18:59:36 cmd/web.go:242:runWeb() [I] Starting Forgejo on PID: 4748
2024/04/23 18:59:36 cmd/web.go:111:showWebStartupMessage() [I] Forgejo version:1.21.11-1 built with GNU Make 4.4.1, go1.21.9 : bindata, pam, sqlite, sqlite_unlock_notify

但是,当我尝试启动 forgejo 服务时,出现以下 pid 未找到错误:

root@Forgejo:/home/jailuser # service forgejo start
/usr/local/etc/rc.d/forgejo: DEBUG: Sourcing /etc/defaults/rc.conf
/usr/local/etc/rc.d/forgejo: DEBUG: pid file (/var/run/forgejo.pid): not readable.
/usr/local/etc/rc.d/forgejo: DEBUG: checkyesno: forgejo_enable is set to YES.
/usr/local/etc/rc.d/forgejo: DEBUG: run_rc_command: doit: forgejo_start

_

root@Forgejo:/home/jailuser # mount
Main/iocage/jails/Forgejo/root on / (zfs, local, noatime, nfsv4acls)
root@Forgejo:/home/jailuser # ll /var
total 81
drwxr-x---   2 root     wheel     2 Mar  1 18:50 account/
drwxr-xr-x   4 root     wheel     4 Mar  1 18:50 at/
drwxr-x---   4 root     audit     4 Mar  1 18:50 audit/
drwxrwx---   2 root     authpf    2 Mar  1 18:50 authpf/
drwxr-x---   2 root     wheel     8 Apr 23 03:21 backups/
drwxr-xr-x   2 root     wheel     2 Mar  1 18:50 cache/
drwxr-x---   2 root     wheel     3 Mar  1 19:06 crash/
drwxr-x---   3 root     wheel     3 Mar  1 18:50 cron/
drwxr-xr-x  14 root     wheel    17 Apr 20 21:43 db/
dr-xr-xr-x   2 root     wheel     2 Mar  1 18:50 empty/
drwxrwxr-x   2 root     games     2 Mar  1 18:50 games/
drwx------   2 root     wheel     2 Mar  1 18:50 heimdal/
drwxr-xr-x   3 root     wheel    23 Apr 23 00:00 log/
drwxrwxr-x   2 root     mail      5 Apr 20 21:01 mail/
drwxr-xr-x   2 daemon   wheel     3 Apr 20 19:28 msgs/
drwxr-xr-x   2 root     wheel     2 Mar  1 18:50 preserve/
drwxr-xr-x   6 root     wheel    18 Apr 23 18:56 run/
drwxrwxr-x   2 root     daemon    2 Mar  1 18:50 rwho/
drwxr-xr-x   9 root     wheel     9 Mar  1 18:50 spool/
drwxrwxrwt   3 root     wheel     3 Mar  1 18:50 tmp/
drwxr-xr-x   3 unbound  unbound   3 Mar  1 18:50 unbound/
drwxr-xr-x   2 root     wheel     4 Mar  1 19:24 yp/
root@Forgejo:/home/jailuser #

手动执行 daemon 命令会导致退出状态为 0,并且没有其他有用信息。尝试将 pid 文件重新定位到具有 777 权限的目录,但仍然出现相同的错误。我现在唯一的猜测是 forgejo 几乎在守护进程能够创建 pid 文件之前就死掉了?不确定如何从 forgejo 获取标准输出以查看是否有任何错误(forgejo 没有将任何内容记录到其日志文件目录中)。有任何想法吗?

相关内容