Skip to content

Commit 9a875a6

Browse files
add console systemd service (#627)
Co-authored-by: Daniel Valdivia <[email protected]>
1 parent abc9f2b commit 9a875a6

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

systemd/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Systemd service for MinIO Console
2+
3+
Systemd script for MinIO Console.
4+
5+
## Installation
6+
7+
- Systemd script is configured to run the binary from /usr/local/bin/.
8+
- Systemd script is configured to run the binary as `console-user`, make sure you create this user prior using service script.
9+
- Download the binary. Find the relevant links for the binary https://github.com/minio/console#binary-releases.
10+
11+
## Create the Environment configuration file
12+
13+
This file serves as input to MinIO Console systemd service.
14+
15+
```sh
16+
$ cat <<EOT >> /etc/default/minio-console
17+
# Special opts
18+
CONSOLE_OPTS="--port 8443"
19+
20+
# salt to encrypt JWT payload
21+
CONSOLE_PBKDF_PASSPHRASE=CHANGEME
22+
23+
# required to encrypt JWT payload
24+
CONSOLE_PBKDF_SALT=CHANGEME
25+
26+
# MinIO Endpoint
27+
CONSOLE_MINIO_SERVER=http://minio.endpoint:9000
28+
29+
EOT
30+
```
31+
32+
## Systemctl
33+
34+
Download `minio-console.service` in `/etc/systemd/system/`
35+
36+
```
37+
( cd /etc/systemd/system/; curl -O https://raw.githubusercontent.com/minio/console/master/systemd/minio-console.service )
38+
```
39+
40+
Enable startup on boot
41+
42+
```
43+
systemctl enable minio-console.service
44+
```
45+
46+
## Note
47+
48+
- Replace ``User=console-user`` and ``Group=console-user`` in minio-console.service file with your local setup.
49+
- Ensure that ``CONSOLE_PBKDF_PASSPHRASE`` and ``CONSOLE_PBKDF_SALT`` are set to appropriate values.
50+
- Ensure that ``CONSOLE_MINIO_SERVER`` is set to appropriate server endpoint.

systemd/console.service

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[Unit]
2+
Description=MinIO Console
3+
Documentation=https://docs.min.io
4+
Wants=network-online.target
5+
After=network-online.target
6+
AssertFileIsExecutable=/usr/local/bin/console
7+
8+
[Service]
9+
WorkingDirectory=/usr/local/
10+
11+
User=console-user
12+
Group=console-user
13+
14+
EnvironmentFile=/etc/default/minio-console
15+
16+
ExecStart=/usr/local/bin/console server $CONSOLE_OPTS
17+
18+
# Let systemd restart this service always
19+
Restart=always
20+
StartLimitBurst=2
21+
StartLimitInterval=5
22+
23+
# Specifies the maximum file descriptor number that can be opened by this process
24+
LimitNOFILE=65536
25+
26+
# Disable timeout logic and wait until process is stopped
27+
TimeoutStopSec=infinity
28+
SendSIGKILL=no
29+
30+
[Install]
31+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)