Can't start gitea on boot


#1

Hey, I’ve been trying to set up gitea to autostart on boot

I’ve tried with a systemd service, a supervisor config and a crontab

I’m running CentOS,
I used this snippet in my crontab:
@reboot “/home/gitea/gitea web”

I used this snippet (and I edited it) with supervisord
[program:gitea]
directory=/home/git/
command=/home/git/gitea web
autostart=true
autorestart=true
startsecs=10
stdout_logfile=/var/log/gitea/stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/var/log/gitea/stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment = HOME="/home/git", USER=“git”

I used the template on the website for the systemd service


#2

This systemd-file works for me:

[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
After=mariadb.service
After=httpd.service

[Service]
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/srv/gitea/gitea
ExecStart=/srv/gitea/gitea/gitea web
Restart=always
Environment=USER=gitea HOME=/srv/gitea

[Install]
WantedBy=multi-user.target

#3

Thanks, I somehow got it to work, even though this was a verbatim of my last config


#4

Windows sc insert system service, restart the operating system, gitea does not start