Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add systemd service file, readme cleanup #9

Merged
merged 6 commits into from
Jul 2, 2018
Merged
Show file tree
Hide file tree
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
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ Here is an example of starting the server on port 8000 and only loading the top
student@SEC573:~$ python domain_stats.py --preload 100 -a ~/Downloads/top-1m.csv 8000
```

Note that a systemd startup file is provided, although you will likely need to adjust paths to the script and `top-1m.csv` file. The provided sample assumes you've cloned this repository to `/usr/local/share/domain_stats/`. Enable with something like the following, again substituting the appropraite paths:
```bash
$ sudo systemctl enable /usr/local/share/domain_stats/systemd/domain_stats.service
$ sudo systemctl start domain_stats.service
```

---

CHANGE LOG: Version 1.0 -> 1.1

*Update code to work in either Python2 or Python3
*Changed Default Content type of server response to TEXT.
*Added -d option which will load top 1000 domains from disk when -a top-1m.csv and --preload are not used.
*Added caching of "Domain not found" responses from WHOIS (Feature Request from resweb10)
*Added update_diskcache.py to create or update the local disk cache.


* Update code to work in either Python2 or Python3
* Changed Default Content type of server response to TEXT
* Added `-d` option which will load top 1000 domains from disk when `-a top-1m.csv` and `--preload` are not used.
* Added caching of "Domain not found" responses from WHOIS (Feature Request from @resweb10)
* Added update_diskcache.py to create or update the local disk cache.
Empty file modified domain_stats.py
100644 → 100755
Empty file.
12 changes: 12 additions & 0 deletions systemd/domain_stats.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Domain Stats Alexa Top 1M Lookup
After=network.target

[Service]
WorkingDirectory=/usr/bin
ExecStart=/usr/local/share/domain_stats/domain_stats.py -a /usr/local/share/domain_stats/top-1m.csv --preload 0 10010
PIDFile=/var/run/domainstats-alexa.pid
Restart=always

[Install]
WantedBy=multi-user.target