Jump to content
Not connected, Your IP:

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

Recommended Posts


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:
Description=Connect to VPN at startup

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


- vpn.sh:

/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 $?

» I am not an AirVPN team member. All opinions are my own and are not official. Refer to Staff postings for the official word.

» These are the community forums, not the support portal. You're writing with other users here.

» New here? LZ1's New User Guide to AirVPN. Use the search function, Luke!

» Tor exits behind a VPN connection are discouraged. Using Tor on the other hand is not.


» Privacy is like alcohol: Drink a little and it can help you stay unnoticed. Drink a lot and everyone will notice you.

» I cannot give you the solution to all your issues. But I can guide you to it. The rest is up to you.

Share this post

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

  • Create New...