Skip to content

Commit

Permalink
Added script to generate systemd service file
Browse files Browse the repository at this point in the history
It is needed for automatic server startup on test machines and VMs
used in automated tests.
  • Loading branch information
gshimansky committed Nov 8, 2018
1 parent d815d2f commit 269f1c2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions install-systemd-service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
if [ ! -z "$1" ]
then
CMD="httpperfserv $1"
else
CMD=httpperfserv
fi

sudo sh -c "cat > /lib/systemd/system/httpperfserv.service <<EOF
[Unit]
Description=Benchmark http server
After=network.target nss-lookup.target
Documentation=https://github.com/vsukhoml/httpperfserv
[Service]
Type=simple
ExecStart=${DIR}/${CMD}
[Install]
WantedBy=multi-user.target
EOF"

sudo systemctl daemon-reload
sudo systemctl enable httpperfserv.service
sudo systemctl start httpperfserv.service

0 comments on commit 269f1c2

Please sign in to comment.