I am trying to get forgejo running as a service in a jail. When I manually start forgejo as the git user it runs as expected, however attempting to get it to run with the included rc file provided by the ports package it errors out.
Forgejo Port
rc.d script
When I start forgejo manually it runs:
However, when I attempt to start the forgejo service I get the following pid not found error:
Manually executing the daemon command results in an exit status of 0 with no other useful information. Tried relocating the pid file to a directory with 777 permissions and still getting the same error. My only guess right now would be that forgejo is dying almost immediately before daemon is able to create the pid file? Not sure how to get stdout from forgejo to see if there are any errors (forgejo is not logging anything to its log file directory). Any ideas?
Forgejo Port
rc.d script
When I start forgejo manually it runs:
Bash:
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
However, when I attempt to start the forgejo service I get the following pid not found error:
Bash:
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
Code:
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 #
Manually executing the daemon command results in an exit status of 0 with no other useful information. Tried relocating the pid file to a directory with 777 permissions and still getting the same error. My only guess right now would be that forgejo is dying almost immediately before daemon is able to create the pid file? Not sure how to get stdout from forgejo to see if there are any errors (forgejo is not logging anything to its log file directory). Any ideas?