Jump to content
Not connected, Your IP: 3.237.94.109
183aTr78f9o

ANSWERED hummingbird as systemd service - network lock not working upon reboot if using the computer's reset button

Recommended Posts

Hello,

I'm using hummingbird as a systemd service in order to automatically connect at startup. It works as expected for the most part but I noticed an issue with network lock lately.

Output of sudo systemctl status hummingbird.service after rebooting manually with the reset button:
 

[sudo] password for user:
● hummingbird.service - Connect to VPN at startup
    Loaded: loaded (/etc/systemd/system/hummingbird.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Fri 2020-07-10 10:00:16 CEST; 8s ago
   Process: 1910 ExecStart=/home/user/scripts/vpn.sh (code=exited, status=1/FAILURE)
  Main PID: 1910 (code=exited, status=1/FAILURE)

Jul 10 10:00:16 archlinux vpn.sh[1914]: This program is already running (PID 20073) or it did not gracefully
Jul 10 10:00:16 archlinux vpn.sh[1914]: exit in its previous execution. In case you have restarted this computer
Jul 10 10:00:16 archlinux vpn.sh[1914]: or just powered it on, you can remove the lock file /etc/airvpn/hummingbird.lock
Jul 10 10:00:16 archlinux vpn.sh[1914]: and start this program again.
Jul 10 10:00:16 archlinux vpn.sh[1914]: In case you are sure this program is not already running and your network
Jul 10 10:00:16 archlinux vpn.sh[1914]: connection is not working as expected, you can run this program with the
Jul 10 10:00:16 archlinux vpn.sh[1914]: "--recover-network" option in order to try restoring your system network
Jul 10 10:00:16 archlinux vpn.sh[1914]: settings.
Jul 10 10:00:16 archlinux systemd[1]: hummingbird.service: Main process exited, code=exited, status=1/FAILURE
Jul 10 10:00:16 archlinux systemd[1]: hummingbird.service: Failed with result 'exit-code'.

At this point, I still have access to the Internet, the traffic isn't routed through AirVPN tunnel at all and my real IP is used. In order to connect to an AirVPN server, I have to manually run sudo hummingbird --recover-network then sudo systemctl restart hummingbird.service.

That's pretty much what I would expect having to do in such scenario, except that I would like the network lock to be working, which is not the case.

What am I doing wrong? I guess that's an issue with the systemd service. Indeed, the network lock works fine if I run `sudo kill -9 $(pidof hummingbird)` while hummingbird is launched via the systemd service.

Relevant details:
  • OS: Arch Linux
  • systemd version: 245.6-8
  • hummingbird version: 1:1.1.0-3 (installed from AUR)
  • hummingbird.service file located in /etc/systemd/system:
 
[Unit]
Description=Connect to VPN at startup
Wants=network-online.target
After=network-online.target

[Service] ExecStart=/home/user/scripts/vpn.sh

[Install]
WantedBy=multi-user.target

- vpn.sh:
 
#!/bin/bash

/usr/bin/hummingbird $(find /home/user/VPN -type f | shuf -n 1)

Thanks in advance for any pointers.

Share this post


Link to post

You could add the following in the [Service] section:

ExecStartPre=/usr/bin/hummingbird --recover-network


This will always execute what you are doing to make it work again, not only after resetting. But that's alright since hummingbird will exit with code 0, anyway, even if it prints two errors:

$ sudo ./hummingbird --recover-network
Hummingbird - AirVPN OpenVPN 3 Client 1.0.3 - 3 June 2020

It seems this program has properly exited in its last run and
it has already restored network settings on exit.

ERROR: Backup copy of resolv.conf not found.
ERROR: Backup copy of network filter not found.

$ echo $?
0


» I am not an AirVPN team member. All opinions are my own and are not to be considered official. Only the AirVPN Staff account should be viewed as such.

» The forums is a place where you can ask questions to the community. You are not entitled to guaranteed answer times. Answer quality may vary, too. If you need professional support, please create tickets.

» If you're new, take some time to read LZ1's New User Guide to AirVPN. On questions, use the search function first. On errors, search for the error message instead.

» If you choose to create a new thread, keep in mind that we don't know your setup. Give info about it. Never forget the OpenVPN logs or, for Eddie, the support file (Logs > lifebelt icon).

» The community kindly asks you to not set up Tor exit relays when connected to AirVPN. Their IP addresses are subject to restrictions and these are relayed to all users of the affected servers.

 

» Furthermore, I propose that your paranoia is to be destroyed. If you overdo privacy, chances are you will be unique amond the mass again.

Share this post


Link to post
Guest
This topic is now closed to further replies.

×
×
  • Create New...