use absolute paths for for earlier versions of systemd

This commit is contained in:
Chris Simons 2020-05-28 22:59:13 -07:00
parent 25a3a86ef6
commit 6deee4cef6
3 changed files with 6 additions and 6 deletions

View File

@ -37,14 +37,14 @@ Environment=XDG_DATA_HOME=/var/lib/barrier/barrier@%i
# TrustedServers.txt Directory
Environment=FP_DIR=/var/lib/barrier/barrier@%i/barrier/SSL/Fingerprints
# Ensure the Fingerprints directory exists
ExecStartPre=mkdir -p "${FP_DIR}"
ExecStartPre=/usr/bin/mkdir -p "${FP_DIR}"
# This uses openssl commands and grep to get the server's key and
# store it in the TrustedServers.txt file. OpenSSL is a requirement
# for barrier on Linux so these commands should exist. This will only
# work if using the default 24800 port (since the port number must be
# specified for openssl)
ExecStartPre=sh -c "[ -f "${FP_DIR}/TrustedServers.txt" ] ||\
ExecStartPre=/usr/bin/sh -c "[ -f "${FP_DIR}/TrustedServers.txt" ] ||\
openssl s_client -connect %i:24800 2>/dev/null |\
openssl x509 -noout -sha1 -fingerprint |\
grep -oE '([A-Z0-9]{2}:?){20}' > ${FP_DIR}/TrustedServers.txt"

View File

@ -28,9 +28,9 @@ Environment=XDG_DATA_HOME=/var/lib/barrier/barrier:24800
Environment=CERT_DIR=/var/lib/barrier/barrier:24800/barrier/SSL
# Create the certificate directory
ExecStartPre=mkdir -p ${CERT_DIR}
ExecStartPre=/usr/bin/mkdir -p ${CERT_DIR}
# Create the Barrier.pem certificate if it doesn't exist
ExecStartPre=sh -c "[ -f ${CERT_DIR}/Barrier.pem ] || openssl req -x509 -nodes -days 365 -subj '/CN=Barrier' -newkey rsa:2048 -text -keyout ${CERT_DIR}/Barrier.pem -out ${CERT_DIR}/Barrier.pem"
ExecStartPre=/usr/bin/sh -c "[ -f ${CERT_DIR}/Barrier.pem ] || openssl req -x509 -nodes -days 365 -subj '/CN=Barrier' -newkey rsa:2048 -text -keyout ${CERT_DIR}/Barrier.pem -out ${CERT_DIR}/Barrier.pem"
# Main executable
ExecStart=/usr/bin/barriers --enable-crypto --display ${DISPLAY} --debug ${LOG_LEVEL} --config /etc/barrier.conf --no-daemon --address :24800

View File

@ -40,9 +40,9 @@ Environment=XDG_DATA_HOME=/var/lib/barrier/barrier%i
Environment=CERT_DIR=/var/lib/barrier/barrier%i/barrier/SSL
# Create the certificate directory
ExecStartPre=mkdir -p ${CERT_DIR}
ExecStartPre=/usr/bin/mkdir -p ${CERT_DIR}
# Create the Barrier.pem certificate if it doesn't exist
ExecStartPre=sh -c "[ -f ${CERT_DIR}/Barrier.pem ] || openssl req -x509 -nodes -days 365 -subj '/CN=Barrier' -newkey rsa:2048 -text -keyout ${CERT_DIR}/Barrier.pem -out ${CERT_DIR}/Barrier.pem"
ExecStartPre=/usr/bin/sh -c "[ -f ${CERT_DIR}/Barrier.pem ] || openssl req -x509 -nodes -days 365 -subj '/CN=Barrier' -newkey rsa:2048 -text -keyout ${CERT_DIR}/Barrier.pem -out ${CERT_DIR}/Barrier.pem"
# Main executable
ExecStart=/usr/bin/barriers --enable-crypto --display ${DISPLAY} --debug ${LOG_LEVEL} --config /etc/barrier.conf --no-daemon --address %i