diff --git a/README.md b/README.md index 63b2e13..bf36a99 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/domain_stats.py b/domain_stats.py old mode 100644 new mode 100755 diff --git a/systemd/domain_stats.service b/systemd/domain_stats.service new file mode 100644 index 0000000..c6a1128 --- /dev/null +++ b/systemd/domain_stats.service @@ -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