38 lines
1.6 KiB
Markdown
38 lines
1.6 KiB
Markdown
# Set of commands
|
|
|
|
Also found [here](https://iratusmachina.com/#production-go-systemd-attempt-four)
|
|
|
|
```sh
|
|
$ cp <BINARY> /usr/local/bin
|
|
$ sudo mkdir -p /var/lib/<your user>
|
|
$ sed -i 's/$MYUSER/<your user>/g' gocustomurls.service
|
|
$ sed -i 's/$MYUSER/<your user>/g' config.json
|
|
$ sudo cp gocustomurls.service /etc/systemd/system/
|
|
$ sudo useradd --system --comment 'Go Custom Urls Service' --no-create-home <your user>
|
|
useradd: failed to reset the lastlog entry of UID 992: No such file or directory
|
|
$ sudo passwd -d <your user>
|
|
passwd: password changed.
|
|
$ getent passwd <your user>
|
|
<your user>:x:992:991:Go Custom Urls Service:/home/<your user>:/bin/bash
|
|
$ sudo cp config.json /var/lib/<your user>
|
|
$ sudo cp rules.json /var/lib/<your user>
|
|
$ sudo ls /var/lib/<your user>/
|
|
config.json rules.json
|
|
$ sudo chmod -R 770 /var/lib/<your user>
|
|
$ sudo chown -R <your user>:<your user> /var/lib/<your user>
|
|
$ sudo systemctl daemon-reload
|
|
$ sudo systemctl start gocustomurls.service
|
|
$ sudo systemctl status gocustomurls.service
|
|
● gocustomurls.service - GocustomUrls. A custom url mapper for go packages!
|
|
Loaded: loaded (/etc/systemd/system/gocustomurls.service; disabled; preset: disabled)
|
|
Drop-In: /usr/lib/systemd/system/service.d
|
|
└─10-timeout-abort.conf
|
|
Active: active (running) since Sat 2024-07-20 06:52:09 UTC; 23s ago
|
|
Main PID: 4020 (gocustomurls)
|
|
Tasks: 6 (limit: 2319)
|
|
Memory: 7.1M (peak: 7.5M)
|
|
CPU: 14ms
|
|
CGroup: /system.slice/gocustomurls.service
|
|
└─4020 /usr/local/bin/gocustomurls -conf /var/lib/<your user>/config.json
|
|
```
|