Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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