gitea/scripts/systemd/gitea@.service

42 lines
1.2 KiB
INI
Raw Normal View History

# Gitea Systemd Template File
# %i is the instance which must have corresponding %i.ini file in config/
# if using a tmpl file you must 'install' gitea first using
# this must installed run via sdinstall script so
# @d can be replaced by the Gitea run directory to be stored in GITEA_DIR
# To use this service with a custom GITEA_DATA_DIR that must be exported in 'env/<instance>.env'
# Otherwise it will use the default which is GITEA_DIR/data
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
# if localtion of Gitea run and data files depend on mounts
# then Requires and After must set
# note, subdirectories use - delimiter not /
Requires=opt.mount
After=opt.mount
Requires=mnt-data.mount
After=mnt-data.mount
# using sqlite so don't need to wait on any of these
#After=mysqld.service
#After=postgresql.service
#After=memcached.service
#After=redis.service
[Service]
# Uncomment and Modify these two values if you have
# repos with lots of files and get an HTTP error 500 because
# of that
#
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
RestartSec=5s
Type=simple
User=sysadmin
Group=sysadmin
Environment=GITEA_DIR=@d
ExecStart=/bin/bash -c '${GITEA_DIR}/scripts/run %i'
Restart=on-failure
[Install]
WantedBy=multi-user.target