2020-05-26 02:38:07 +00:00
|
|
|
# Barrier Server service barriers-@BARRIER_VERSION@
|
|
|
|
#
|
|
|
|
# This file is part of Barrier.
|
|
|
|
#
|
|
|
|
# This systemd service starts barrier on the default port 24800.
|
|
|
|
#
|
2020-05-26 23:26:26 +00:00
|
|
|
# SSL data is stored in /var/lib/barrier:24800/barrier/SSL
|
2020-05-26 02:38:07 +00:00
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=Barrier Server listening on 24800 (Open-source KVM software)
|
|
|
|
Documentation=man:barriers(1) man:barrierc(1)
|
|
|
|
Documentation=https://github.com/debauchee/barrier/wiki
|
|
|
|
# Require network before starting barrierc
|
|
|
|
After=network-online.target
|
|
|
|
Wants=network-online.target
|
|
|
|
# Don't run server if client or another instance is running
|
|
|
|
Conflicts=barrierc@.service barriers@.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=exec
|
|
|
|
# Log level may be FATAL, ERROR, WARNING, NOTE, INFO, DEBUG, DEBUG1, DEBUG2
|
|
|
|
Environment=LOG_LEVEL=INFO
|
|
|
|
# Default display is :0
|
|
|
|
Environment=DISPLAY=:0
|
|
|
|
# Store SSL data in instance specific directories
|
2020-05-26 23:26:26 +00:00
|
|
|
Environment=XDG_DATA_HOME=/var/lib/barrier:24800
|
2020-05-26 02:38:07 +00:00
|
|
|
# SSL data directory
|
2020-05-26 23:26:26 +00:00
|
|
|
Environment=CERT_DIR=/var/lib/barrier:24800/barrier/SSL
|
2020-05-26 02:38:07 +00:00
|
|
|
|
|
|
|
# Create the certificate directory
|
|
|
|
ExecStartPre=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"
|
|
|
|
|
|
|
|
# Main executable
|
|
|
|
ExecStart=/usr/bin/barriers --enable-crypto --display ${DISPLAY} --debug ${LOG_LEVEL} --config /etc/barrier.conf --no-daemon --address :24800
|
|
|
|
# Restart on fail
|
|
|
|
Restart=always
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
# Install to graphical target
|
|
|
|
WantedBy=graphical.target
|