Commit graph

17 commits

Author SHA1 Message Date
Gusted 674c579879
[BRANDING] Rebrand systemd service (#137)
- We can rebrand this quite safely, as only new installations would likely look into this file and configure the correct folders(to use forgejo instead of gitea).

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/137
(cherry picked from commit fa78e52b5d25556b4a4313c4ac78edf6306c5bbe)
(cherry picked from commit e36d649989a69a1761c3d7cc709f97f80c8d378a)
(cherry picked from commit 37e15a2f4108c4b7e082a69fb8cb77068fa6dc15)
(cherry picked from commit a09a4b3ce0b6f63ac44bf4ea0f4ba275a9915598)
(cherry picked from commit 3096b37c950db77296f22d16d64efe3737246a4b)
(cherry picked from commit 187ad96c94b7fbc261c88a4ff513066acc562642)
(cherry picked from commit e15eb31c6e6310d14175cc270707d7cbfb95b819)
(cherry picked from commit e276abe3410cef5fe63bf05c6f089ed4a3da49dc)
(cherry picked from commit 31223db5e3290ccf67a504db1937e5adb903b204)
(cherry picked from commit 8ebffe0b71db27b40f2049ca77878748e6756ec1)
(cherry picked from commit 1d198363469814584c50e4717a7f96cafb06aa46)
(cherry picked from commit baaf749ce07f978466d6c397c1ed6bb6a1c75330)

Conflicts:
	contrib/systemd/forgejo.service
(cherry picked from commit c309b1a1f4fa2942218352a6ec3edbf39efb9a11)
(cherry picked from commit d6f57409dacf2645cd19bcd8a79219a9a8c1bffe)
(cherry picked from commit c6e665b0380f1d70c8c378b65c369a85eab9664c)
(cherry picked from commit 8764e26c434ec8027acaaabdf65e3122e5965178)
(cherry picked from commit a0560e454b4d5d7dac357a95dbaeb2b187a173ff)
(cherry picked from commit e074e83094866421f94cb3cef912794a31b88c82)
(cherry picked from commit 605b84bc779d41deac03595c8ddb7fa12b2b24e8)
(cherry picked from commit 35b233202058e219dec5acfc72ff0d7085a41318)
(cherry picked from commit b9c396f29566ec064a7c4031d4f766a25594eba4)
(cherry picked from commit 83a7e91bad1d99092c8c553ce740c65256901abb)
(cherry picked from commit 3794ad271a40bb4212cb14e24a6100b539d3a776)
(cherry picked from commit 818451287d166658f6ce18892a6ed9811324aa67)
(cherry picked from commit ec9bc9e6417fd7df3e636c231fb80a3442972542)
(cherry picked from commit 8434efaed8637351f6fe53c01dd4fb3edf09fce1)
(cherry picked from commit 3b1a4b7f389e7548f94d2d1b742de086aa77bfc6)
(cherry picked from commit c186b5a3e51c24f795967dc4811d89ed0b841b24)
(cherry picked from commit e35d92de1f37bea0a593093678f093845955e3fc)
(cherry picked from commit c8bb51718360d1e90716c5c6253c55a6d7817a7e)
(cherry picked from commit 9ac843d662122c5585a53a1aa9df1662adecb41f)
(cherry picked from commit 86c723ca0a1b68ee204188cc45977d78ab7d8c7c)
(cherry picked from commit c662da2a84e2266e571cea91cdedcf1a9906cd1a)
(cherry picked from commit 6f9390ed438fbae94698f56be1f98a63c88241c1)
(cherry picked from commit 684f80f7cebce8d0942ca892557d1890a19c8d4f)
(cherry picked from commit 0e28b2a57fd88d8e2df245cc4740b56e72fed9c9)
(cherry picked from commit ded78839e42f5ef92ec685fe8e81ddf4e0839d32)
(cherry picked from commit 33720ba9554cdae8e6f0d7891145b81eb105c3b3)
(cherry picked from commit b39b88fd01deb34b40c489f393d67873fb5d758f)
(cherry picked from commit 666ae3c7b21f69877c8c7fe7b17a188a5068aa04)
(cherry picked from commit ac968a29b3e5a3c346e77271b80a4aa3664bec12)
(cherry picked from commit 72d83381f366e63bf66066119c7a668558d75739)
(cherry picked from commit bb73be008bc73d6e1b16cd6c62f0b287ff8ed204)
(cherry picked from commit 8c38bbe481b2f0ccd0c5185f6ffaa02b8b6993b2)
(cherry picked from commit 9e4ff9a3dfd0420e8f7ad9cd3dbbd5144fa55aac)

Conflicts:
	contrib/systemd/forgejo.service
	https://codeberg.org/forgejo/forgejo/pulls/2116
(cherry picked from commit 3a878dbefee46b1dd7ef96418c2e585a169cade1)
(cherry picked from commit 63d014f13ccdb9a9bd547a1f02f07845a1fcb6a8)
(cherry picked from commit d231e454a57d5d0e6fdb0a6075172292a6770905)
(cherry picked from commit 0996e3a9c97ea858a9238a5f42cd2ea3da7c5ebe)
2024-02-05 16:02:13 +01:00
wxiaoguang 79da4bbc56
Suggest to use Type=simple for systemd service (#28717)
Although the systemd notify support was added, it seems that there are
some problems (#28553, for the "non-installed" instance)
2024-01-07 15:18:04 +00:00
zeripath 7565e5c3de
Implement systemd-notify protocol (#21151)
This PR adds support for the systemd notify protocol. Several status
messagess are provided. We should likely add a common notify/status
message for graceful.

Replaces #21140

Signed-off-by: Andrew Thornton <art27@cantab.net>

---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: ltdk <usr@ltdk.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-05-15 22:20:30 +00:00
plsnp a99074b267
Update gitea.service (#21399)
`LimitMEMLOCK=infinity` is already the default, so removed that

Default soft limit for LimitNOFILE is 1024
Default hard limit for LimitNOFILE is 524288

`LimitNOFILE=65535` increases the soft limit, but decreases the hard
limit

References:
* https://www.freedesktop.org/software/systemd/man/systemd.exec.html
*
https://blog.skbali.com/2019/09/set-ulimits-for-a-script-started-using-systemd/

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-10-11 12:26:32 -04:00
CLanguagePurist 6247a1dd5d
Comment on PrivateUsers option for gitea.service (#20383)
* Comment on PrivateUsers option for gitea.service

A user happens to encounter an issue where PrivateUsers sandboxed Gitea.service and it effectively stop systemd from applying capabilities for that gitea.service. I am opening this PR to provide comments on PrivateUsers, effectively a tiny FAQ information for end-user.
2022-07-16 14:58:56 +02:00
silverwind 4c3e56da13
Use Wants= over Requires= in systemd file (#15897)
`Requires=` has the behaviour of stopping `gitea.service` when the
database is stopped but not bringing it up again after the database is
started again. Use `Wants=` to define a weak requirement instead,
meaning `gitea.service` will be kept running when the database is
stopped, which is not an issue because gitea will just reconnect later
on.

Fixes: https://github.com/go-gitea/gitea/issues/15866

Co-authored-by: zeripath <art27@cantab.net>
2021-05-17 16:09:15 +03:00
zeripath 3a04d6f43f
Systemd needs After as well as Require (#15881)
If the gitea service is stopped because of the db going down
it needs an `After=db.service` to ensure it is restarted in
addition to the `Requires=db.service` to ensure that the db
is started before gitea is started.

Fix #15866

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-05-16 16:41:37 +08:00
Bagas Sanjaya eab5837142
systemd service: Add commented PATH environment option for Git prefix (#13170)
On some setups, Git is installed to directory prefix other than default
PATH (such as /opt/git/bin). For Gitea to know such Git installations,
PATH environment must be specified on service file.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-10-24 17:13:59 -04:00
Anthony Vanelverdinghe 44ec9b933a Rephrase comment about RuntimeDirectory option (#8912) 2019-11-10 11:49:39 -05:00
Ramon Fischer 2282c659dd Explicity indicate the socket unit to use the service unit "gitea.service" (#8804)
* rename socket file, make example more precise, use long parameter name

* correct path

* use the correct path to the configuration file according to the documentation

* rename the socket unit back to 'gitea.main.socket', explicitly indicate that the socket unit should use the service file 'gitea.service'
2019-11-04 12:42:30 +08:00
zeripath 0b44f0c465
Update the provided gitea.service to mention socket activation (#8531)
* Update the provided gitea.service since we have graceful restarting again

* Update contrib/systemd/gitea.service

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-10-16 08:29:50 +01:00
Thomas McWork bc5a479fef Add unix socket help (#8377)
When using unix socket as listener (`HTTP_ADDR = /run/gitea/gitea.socket`) then it's required to have the folder `/run/gitea` with appropriate owner/group. Manual creation leads to vanishing after reboot. This directive enables Systemd to handle this.
2019-10-06 14:32:23 -04:00
techknowlogick dbb4aeead9
Change systemd service file to more correctly match Debian & Centos - Fix #4391 (#5777) 2019-01-19 23:55:39 -05:00
Lauris BH 1aee261aae More detailed documentation on how to set up from binary (#4121)
* More detailed documentation on how to set up from binary
Also change recommended file locations
2018-06-04 22:02:04 -04:00
techknowlogick af62ec5cc0 Note about adding permisions to binary (#3936)
in regards to binding to lower ports than 1024
2018-05-10 16:32:01 +08:00
William Mantly Jr e4f96c60cd App restarts to quickly if it fails to start. (#2945) 2017-11-21 01:37:23 +02:00
Thomas Boerger a06c3ad2c0 Synced gitignores with github repo (#1245)
* Renamed scripts directory into contrib

* Added script to download gitignores from github

* Synced gitignores with github repo
2017-03-15 13:30:00 +01:00