From 7708c2c8fe6c2b4aee3199affdac9707731e4eab Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Tue, 15 Oct 2019 21:23:22 +0100 Subject: [PATCH 1/2] Update the provided gitea.service since we have graceful restarting again --- contrib/systemd/gitea.service | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/contrib/systemd/gitea.service b/contrib/systemd/gitea.service index b7e6629ebfe13..7c7db041c1e20 100644 --- a/contrib/systemd/gitea.service +++ b/contrib/systemd/gitea.service @@ -2,11 +2,41 @@ Description=Gitea (Git with a cup of tea) After=syslog.target After=network.target +### +# Don't forget to add the database service requirements +### +# #Requires=mysql.service #Requires=mariadb.service #Requires=postgresql.service #Requires=memcached.service #Requires=redis.service +# +### +# If using socket activation for main http/s +### +# +#After=gitea.main.socket +#Requires=gitea.main.socket +# +### +# (You can also provide gitea an http fallback and/or ssh socket too) +# +# An example of /etc/systemd/system/gitea.main.socket +### +## +## [Unit] +## Description=Gitea Web Socket +## PartOf=gitea.service +## +## [Socket] +## ListenStream= +## NoDelay=true +## +## [Install] +## WantedBy=sockets.target +## +### [Service] # Modify these two values and uncomment them if you have @@ -27,10 +57,11 @@ ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini Restart=always Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea # If you want to bind Gitea to a port below 1024 uncomment -# the two values below +# the two values below, or use socket activation to pass Gitea its ports as above ### #CapabilityBoundingSet=CAP_NET_BIND_SERVICE #AmbientCapabilities=CAP_NET_BIND_SERVICE +### [Install] WantedBy=multi-user.target From 1480b372e878b16783b05e6a0b198889629336db Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 16 Oct 2019 06:54:13 +0100 Subject: [PATCH 2/2] Update contrib/systemd/gitea.service Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> --- contrib/systemd/gitea.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/gitea.service b/contrib/systemd/gitea.service index 7c7db041c1e20..b5aa6ffcb5cab 100644 --- a/contrib/systemd/gitea.service +++ b/contrib/systemd/gitea.service @@ -56,7 +56,7 @@ WorkingDirectory=/var/lib/gitea/ ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini Restart=always Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea -# If you want to bind Gitea to a port below 1024 uncomment +# If you want to bind Gitea to a port below 1024, uncomment # the two values below, or use socket activation to pass Gitea its ports as above ### #CapabilityBoundingSet=CAP_NET_BIND_SERVICE