Skip to content

Commit b822518

Browse files
bagasmesapk
andcommitted
[Docs] Linux Service Edit (#9633)
* Rename h3 title * Add intro Should work on Ubuntu Xenial, but should work on any Linux distros. * Indirect edit files Instead of providing `sudo vim`, invite to edit files. * enable now instead of enable and start * Re-add systemctl enable && systemctl start * Revert service enablement back to status quo * Add enable now counterpart for systemd > v220 * Apply suggestions from @sapk Strip `vim` from editor usage Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
1 parent c779ac1 commit b822518

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

docs/content/doc/installation/run-as-service-in-ubuntu.en-us.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ menu:
1313
identifier: "linux-service"
1414
---
1515

16-
### Run as service in Ubuntu 16.04 LTS
16+
### Run Gitea as Linux service
1717

18-
#### Using systemd
18+
You can run Gitea as service, using either systemd or supervisor. The steps below tested on Ubuntu 16.04, but those should work on any Linux distributions (with little modification).
1919

20-
Run the below command in a terminal:
21-
```
22-
sudo vim /etc/systemd/system/gitea.service
23-
```
20+
#### Using systemd
2421

25-
Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service).
22+
Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service) to `/etc/systemd/system/gitea.service`, then edit the file with your favorite editor.
2623

2724
Uncomment any service that needs to be enabled on this host, such as MySQL.
2825

@@ -35,6 +32,10 @@ sudo systemctl enable gitea
3532
sudo systemctl start gitea
3633
```
3734

35+
If you have systemd version 220 or later, you can enable and immediately start Gitea at once by:
36+
```
37+
sudo systemctl enable gitea --now
38+
```
3839

3940
#### Using supervisor
4041

@@ -49,19 +50,20 @@ Create a log dir for the supervisor logs:
4950
mkdir /home/git/gitea/log/supervisor
5051
```
5152

52-
Open supervisor config file in a file editor:
53-
```
54-
sudo vim /etc/supervisor/supervisord.conf
55-
```
56-
5753
Append the configuration from the sample
58-
[supervisord config](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea).
54+
[supervisord config](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea) to `/etc/supervisor/supervisord.conf`.
5955

60-
Change the user (git) and home (/home/git) settings to match the deployment
61-
environment. Change the PORT or remove the -p flag if default port is used.
56+
Using your favorite editor, change the user (git) and home
57+
(/home/git) settings to match the deployment environment. Change the PORT
58+
or remove the -p flag if default port is used.
6259

6360
Lastly enable and start supervisor at boot:
6461
```
6562
sudo systemctl enable supervisor
6663
sudo systemctl start supervisor
6764
```
65+
66+
If you have systemd version 220 or later, you can enable and immediately start supervisor by:
67+
```
68+
sudo systemctl enable supervisor --now
69+
```

0 commit comments

Comments
 (0)