Lookyloo / lookyloo

Lookyloo is a web interface that allows users to capture a website page and then display a tree of domains that call each other.
https://www.lookyloo.eu
Other
683 stars 83 forks source link

Errors when setting up lookyloo.service #37

Closed ahezza closed 5 years ago

ahezza commented 5 years ago

Hello, Is anyone able to share their copy of /etc/systemd/system/lookyloo.service ?

Here is mine:

[Unit]
Description=uWSGI instance to serve lookyloo
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/opt/lookyloo
Environment=PATH="/usr/bin/python"
ExecStart=/opt/lookyloo/bin/start.py
Environment=LOOKYLOO_HOME=/opt/lookyloo

[Install]
WantedBy=multi-user.target

And I'm getting the following error:

# sudo systemctl status lookyloo
● lookyloo.service - uWSGI instance to serve lookyloo
   Loaded: loaded (/etc/systemd/system/lookyloo.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-04-04 13:47:44 CEST; 2min 48s ago
  Process: 3857 ExecStart=/opt/lookyloo/bin/start.py (code=exited, status=126)
 Main PID: 3857 (code=exited, status=126)

Apr 04 13:47:44 server systemd[1]: Started uWSGI instance to serve lookyloo.
Apr 04 13:47:44 server systemd[1]: lookyloo.service: Main process exited, code=exited, status=126/n/a
Apr 04 13:47:44 server start.py[3857]: /usr/bin/env: ‘python3’: Not a directory
Apr 04 13:47:44 server systemd[1]: lookyloo.service: Failed with result 'exit-code'.
Rafiot commented 5 years ago

python3 is required, it seems you're pointing to python2. I'm not sure it will solve it, but that's definitely a starting point. Note that lookyloo assumes you're working in a python virtual environment and use pipenv.

I'll check my systemd service asap and paste it here.

ahezza commented 5 years ago

I've tried updating the line to:

Environment=PATH="/usr/bin/python3"

And I get the same error

Rafiot commented 5 years ago

Just making sure: Did you follow the installation process?

And running the following command worked?

pipenv run start.py
ahezza commented 5 years ago

Yep that command works for me. I'm pretty sure I've set the Environment path wrong for pipenv as I've just set it for python3, but I'm not overly familiar with pipenv's usage.

ahezza commented 5 years ago

And yes I did follow the installation process as linked

Rafiot commented 5 years ago

Alright, I may not have been using it for some time now and it is totally broken. Trying to fix it now...

Sorry for that .

ahezza commented 5 years ago

No problem, please let me know once you’ve managed to fix it 🙂

On 4 Apr 2019, at 17:32, Raphaël Vinot notifications@github.com wrote:

Alright, I may not have been using it for some time now and it is totally broken. Trying to fix it now...

Sorry for that .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Rafiot commented 5 years ago

I did a bunch of changes yesterday and it should be working now.

ahezza commented 5 years ago

I downloaded your updated version, and updated my service file to the following:

[Unit]
Description=uWSGI instance to serve lookyloo
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/opt/lookyloo
Environment=PATH=/root/.local/share/virtualenvs/lookyloo-Q2m2QRHy/bin/
ExecStart=/opt/lookyloo/bin/start.py
Environment=LOOKYLOO_HOME=/opt/lookyloo

[Install]
WantedBy=multi-user.target

The service seems to run initially, but then it changes it status to inactive (dead), see below:

# sudo systemctl status lookyloo.service
● lookyloo.service - uWSGI instance to serve lookyloo
   Loaded: loaded (/etc/systemd/system/lookyloo.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sun 2019-04-07 14:40:35 CEST; 11s ago
  Process: 14814 ExecStart=/opt/lookyloo/bin/start.py (code=exited, status=0/SUCCESS)
 Main PID: 14814 (code=exited, status=0/SUCCESS)

Apr 07 14:40:31 server systemd[1]: Started uWSGI instance to serve lookyloo.
Apr 07 14:40:33 server start.py[14814]: + ../../redis/src/redis-server ./cache.conf
Apr 07 14:40:33 server start.py[14814]: 14925:C 07 Apr 2019 14:40:33.817 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
Apr 07 14:40:33 server start.py[14814]: 14925:C 07 Apr 2019 14:40:33.822 # Redis version=5.0.4, bits=64, commit=f72f4ea3, modified=0, pid=14925, just started
Apr 07 14:40:33 server start.py[14814]: 14925:C 07 Apr 2019 14:40:33.822 # Configuration loaded
Apr 07 14:40:34 server start.py[14814]: Waiting on cache

I managed to work out the virtual environment part (I think) but you may want to update your installation documentation to the below:

Installation of Lookyloo

git clone https://github.com/CIRCL/lookyloo.git
cd lookyloo
pipenv install
pipenv shell
# take note of the path, for example /home/.local/share/virtualenvs/lookyloo-Q2m2QRHy/bin, this will be used when updating your environment etc/systemd/system/lookyloo.service when running app in production
exit
echo LOOKYLOO_HOME="'`pwd`'" > .env

Any ideas why my service isn't running still?

Rafiot commented 5 years ago

Yes, that's not the updated one: https://github.com/CIRCL/lookyloo/blob/master/etc/systemd/system/lookyloo.service.sample

ahezza commented 5 years ago

That's done the trick! Thanks for your help 👍