Skip to content

Autostart on Linux

Snawoot edited this page Jun 25, 2021 · 6 revisions

systemd

System-wide

Assuming you have placed opera-proxy at path /usr/local/bin/opera-proxy.

Create file with following content in /etc/systemd/system/opera-proxy.service:

[Unit]
Description=Opera VPN
Documentation=https://github.com/Snawoot/opera-proxy/
After=network.target network-online.target
Requires=network-online.target

[Service]
EnvironmentFile=/etc/default/opera-proxy
User=nobody
Group=nogroup
ExecStart=/usr/local/bin/opera-proxy $OPTIONS
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full

[Install]
WantedBy=default.target

Create file /etc/default/opera-proxy with content like this:

OPTIONS=-country EU

Reload systemd, enable unit autostart and start daemon:

systemctl daemon-reload
systemctl enable opera-proxy
systemctl restart opera-proxy

Check log output with following command:

journalctl -u opera-proxy -n 30

User service

Assuming you have placed opera-proxy at path /home/user/bin/opera-proxy.

Create file with following content in /home/user/.config/systemd/user/opera-proxy.service:

[Unit]
Description=Opera VPN
Documentation=https://github.com/Snawoot/opera-proxy/

[Service]
EnvironmentFile=/home/user/.config/opera-proxy
ExecStart=/home/user/bin/opera-proxy $OPTIONS
TimeoutStopSec=5s

[Install]
WantedBy=default.target

Create file /home/user/.config/opera-proxy with content like this:

OPTIONS=-country EU

Reload systemd, enable unit autostart and start daemon:

systemctl --user daemon-reload
systemctl --user enable  opera-proxy
systemctl --user restart opera-proxy

Check log output with following command:

journalctl --user -u opera-proxy -n 30
Clone this wiki locally