I’m preparing a fresh gitea instance. Unfortunately, it doesn’t start up.
I’m using ubuntu-20.04 and gitea-1.13.2.
Within the system journal journalctl -xe
, I get these errors:
Feb 18 00:06:02 dp-gitea gitea[89199]: 2021/02/18 00:06:02 ...dules/setting/git.go:91:newGit() [I] Git Version: 2.25.1, Wire Protocol Version 2 Enabled
Feb 18 00:06:02 dp-gitea gitea[89199]: 2021/02/18 00:06:02 routers/init.go:129:GlobalInit() [F] Git module init failed: Failed to set git user.name(exec(3:git.Init(set user.name)) failed: exit status 255(<nil>) stdout: stderr: error: could not lock config file ~/.gitconfig: Permission denied
Feb 18 00:06:02 dp-gitea gitea[89199]: ): error: could not lock config file ~/.gitconfig: Permission denied
Feb 18 00:06:02 dp-gitea gitea[89199]:
Feb 18 00:06:02 dp-gitea systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit gitea.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Feb 18 00:06:02 dp-gitea systemd[1]: gitea.service: Failed with result 'exit-code'.
I do know the special behavior of “~” and its relation to $HOME.
Normally, I would assume that gitea is trying to open a file named “.gitconfig” within the
home folder of the user executing the gitea command (named “gitea” in my case).
Looking at ~gitea, I see the file exists:
root@dp-gitea:~/systemd# ls -la ~gitea
...
-rw-rw-r-- 1 gitea gitea 162 Feb 17 20:42 .gitconfig
At some point, I got the idea to create “~gitea/~”. After this, gitea does start up.
After starting gitea, a file named “~gitea/~/.gitconfig” got created:
root@dp-gitea:~/systemd# ls -la ~gitea
...
drwxr-xr-x 1 gitea gitea 20 Feb 18 00:06 '~'
...
root@dp-gitea:~/systemd# ls -la ~gitea/~
total 4
drwxr-xr-x 1 gitea gitea 20 Feb 18 00:06 .
drwxr-xr-x 1 gitea gitea 110 Feb 18 00:05 ..
-rw-r--r-- 1 gitea gitea 162 Feb 18 00:06 .gitconfig
Pretty ugly, but it works.
Afterwards, I tried changing the login shell of the user “gitea” from /bin/sh to /bin/bash, no success. The folder “~gitea/~” is still required.
Do you have any idea how I can get rid off this ugly folder? Thx, Uli