-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script to generate systemd service file
It is needed for automatic server startup on test machines and VMs used in automated tests.
- Loading branch information
1 parent
d815d2f
commit 269f1c2
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |