Skip to content
This repository was archived by the owner on Dec 2, 2017. It is now read-only.

Commit 0a31ea5

Browse files
Ariflafriks
authored andcommitted
Run as systemd service ubuntu (#149)
* Run as service in Ubuntu 16.04 via supervisor * Updated mkdir command as sudo not required for user home dir * Updates: added empty lines, ref and fixed few typos * Updates: added empty line * Updates: added identifier changes * Newline after Run as service line * Added systemd service * Removed systemd title * Fix typo * Fixed invalid MD syntax, moved systemd to the top * Removed code part
1 parent 32df387 commit 0a31ea5

File tree

1 file changed

+39
-24
lines changed

1 file changed

+39
-24
lines changed

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

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,54 @@ menu:
1515

1616
### Run as service in Ubuntu 16.04 LTS
1717

18+
#### Using systemd
19+
20+
Run below command in terminal:
21+
```
22+
sudo vim /etc/systemd/system/gitea.service
23+
```
24+
25+
Add code to the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service).
26+
27+
Uncomment any service need to be enabled like mysql in this case in Unit section.
28+
29+
Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used.
30+
31+
Lastly start and enable gitea at boot:
32+
```
33+
sudo systemctl start gitea
34+
```
35+
```
36+
sudo systemctl enable gitea
37+
```
38+
39+
1840
#### Using supervisor
1941

2042
Install supervisor by running below command in terminal:
21-
```sudo apt install supervisor```
43+
```
44+
sudo apt install supervisor
45+
```
2246

2347
Create a log dir for the supervisor logs(assuming gitea is installed in /home/git/gitea/):
24-
```mkdir /home/git/gitea/log/supervisor```
48+
```
49+
mkdir /home/git/gitea/log/supervisor
50+
```
2551

2652
Open supervisor config file in vi/vim/nano etc.
27-
```sudo vim /etc/supervisor/supervisord.conf```
28-
29-
And append the following code at the end of the file, [reference](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea):
30-
```
31-
[program:gitea]
32-
directory=/home/git/gitea/
33-
command=/home/git/gitea/gitea web -p PORT
34-
autostart=true
35-
autorestart=true
36-
startsecs=10
37-
stdout_logfile=/home/git/gitea/log/supervisor/stdout.log
38-
stdout_logfile_maxbytes=1MB
39-
stdout_logfile_backups=10
40-
stdout_capture_maxbytes=1MB
41-
stderr_logfile=/home/git/gitea/log/supervisor/stderr.log
42-
stderr_logfile_maxbytes=1MB
43-
stderr_logfile_backups=10
44-
stderr_capture_maxbytes=1MB
45-
user = git
46-
environment = HOME="/home/git", USER="git"
53+
```
54+
sudo vim /etc/supervisor/supervisord.conf
4755
```
4856

57+
And append the code at the end of the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea).
58+
4959
Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used.
5060

5161
Lastly start and enable supervisor at boot:
52-
```sudo systemctl start supervisor```
53-
```sudo systemctl enable supervisor```
62+
```
63+
sudo systemctl start supervisor
64+
```
65+
```
66+
sudo systemctl enable supervisor
67+
```
68+

0 commit comments

Comments
 (0)