LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   New PIA needs systemd (https://www.linuxquestions.org/questions/slackware-14/new-pia-needs-systemd-4175648434/)

chris.willing 02-16-2019 07:43 AM

New PIA needs systemd
 
I just tried update to the latest PIA (Private Internet Access) and it gave me the following:
Code:

chris@d7:/tmp$  sh /storage/PIA/pia-linux-1.0.2-02363.run
Verifying archive integrity...  100%  MD5 checksums are OK. All good.
Uncompressing Private Internet Access  100% 

=================================
Private Internet Access Installer
=================================

A systemd based OS is required to run this program

Has anyone worked around this yet?

chris

chud1950 02-16-2019 12:10 PM

Until you figure this out, you could just download their configuration files from here: https://www.privateinternetaccess.com/pages/download#
then use openvpn like so:
openvpn --config nameofconfigfile. It will ask for your userid and password which presumably you got from PIA.

You might want to contact PIA and let them know their installer is giving this error message.

bassmadrigal 02-16-2019 12:34 PM

If you run the script with the option --keep, it won't delete the extracted directory. Then you can go in and manually edit the install.sh file to remove the check for systemctl (it calls hash against it, so you can't simply create a systemctl file). Or you can use the install.sh script as a basis to create a SlackBuild. A basic SlackBuild like the below should work. Feel free to take it and run with it.

I haven't tested this other than to make sure it makes a Slackware package. I don't know if permissions will need to be tweaked or if you'll need to create an rc.pia startup file.

Code:

#!/bin/bash

PRGNAM=pia
VERSION=${VERSION:-1.0.2_02363}
SRCVER=$(echo $VERSION | tr _ - )
BUILD=${BUILD:-1}
TAG=${TAG:-_bass}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) echo "UNSUPPORTED ARCH" && exit 1 ;;
    arm*) echo "UNSUPPORTED ARCH" && exit 1 ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM ${PRGNAM}-${SRCVER}
sh $CWD/$PRGNAM-linux-$SRCVER.run --keep 2>/dev/null
cd $PRGNAM-linux-$SRCVER

mkdir -p $PKG/opt/piavpn
cp -rf piafiles/* $PKG/opt/piavpn
cp installfiles/*.sh $PKG/opt/piavpn/bin
chmod +x $PKG/opt/piavpn/bin/{pia-uninstall,run-in-terminal}.sh

mkdir -p $PKG/usr/share/{pixmaps,applications}
cp installfiles/pia.png $PKG/usr/share/pixmaps/pia.png
cp installfiles/piavpn.desktop $PKG/usr/share/applications/piavpn.desktop

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

I've always just used openvpn to connect to pia with the following openvpn.conf:

Code:

jbhansen@craven-moorhead:~$ sudo cat /etc/openvpn/openvpn.conf
client
dev tun
proto udp
remote ca-vancouver.privateinternetaccess.com 1198
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-128-cbc
auth sha1
tls-client
remote-cert-tls server
auth-user-pass /etc/openvpn/login.txt
auth-nocache
comp-lzo
verb 1
reneg-sec 0
crl-verify /etc/openvpn/crl.rsa.2048.pem
ca /etc/openvpn/ca.rsa.2048.crt
disable-occ
script-security 2
route-noexec

up /etc/openvpn/iptables.sh
down /etc/openvpn/update-resolv-conf

My login credentials are in /etc/openvpn/login.txt, but I don't remember where I got the .pem and .crt certificates, but I know you can extract them from openvpn zip files that contain ovpn files.

chris.willing 02-17-2019 06:13 AM

Quote:

Originally Posted by bassmadrigal (Post 5962922)
If you run the script with the option --keep, it won't delete the extracted directory. Then you can go in and manually edit the install.sh file to remove the check for systemctl (it calls hash against it, so you can't simply create a file).

Thanks, that did most of what was needed. The extra bit was to set up a daemon to run at system startup. I set that up with a script in /etc/NetworkManager/dispatcher.d/ (to start the daemon when network becomes available). In systems not using NetworkManager, that could also be done in rc.local.

chris

chris.willing 11-06-2019 12:57 AM

PIA has been running nicely since February (when this thread started). It's gui, which I rarely need to open, recently mentioned that an update (version 1.5.1) was available. This version requires no editing of the install.sh file. Instead, it takes options:
Code:

chris@d7:/tmp/pia-linux-1.5.1-03605$ ./install.sh --help

=================================
Private Internet Access Installer
=================================

Usage: pia-linux-<version>.run -- <install-options>
Install options:
  --systemd to setup a systemd service on boot
  --sysvinit to setup a sysvinit service on boot
  --skip-service to skip setting up a service

Since I start my PIA service from a script in /etc/NetworkManager/dispatcher.d/, I can just run the installer with the --skip-service option. For those who prefer to start from it from /etc/rc.d/, a piavpn.sysvinit.service file is provided (it's a regular shell script, despite the name), so you could then run the installer with the --sysvinit option instead.

chris


All times are GMT -5. The time now is 04:10 AM.