mkdir /srv/hellcheck
vim /srv/hellcheck/index.html
<h1>It works!</h1>
vim /etc/systemd/system/hellcheck.service
systemctl daemon-reload
systemctl restart hellcheck.service
journalctl -u hellcheck.service
systemctl enable hellcheck.service
[Unit] | |
Description=Job that runs the python SimpleHTTPServer daemon at TCP port 80 | |
Documentation=man:SimpleHTTPServer(1) | |
After=network-online.target | |
[Service] | |
Type=simple | |
WorkingDirectory=/srv/hellcheck | |
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 & | |
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'` | |
[Install] | |
WantedBy=multi-user.target |
mkdir /srv/hellcheck
vim /srv/hellcheck/index.html
<h1>It works!</h1>
vim /etc/systemd/system/hellcheck.service
systemctl daemon-reload
systemctl restart hellcheck.service
journalctl -u hellcheck.service
systemctl enable hellcheck.service