Update for Ubuntu 22.04. Debian 11
git clone https://github.com/ReconInfoSec/graylog2thehive.git /opt/graylog2thehive
Add a run_as user/group ie: myusername
root@thehive:/opt/graylog2thehive# adduser myusername root@thehive:/opt/graylog2thehive# chown myusername:myusername /opt/graylog2thehive/ -R
Update the .service file with the local username/group, and change to python3
cat init.d/graylog2thehive.service [Unit] Description=graylog2thehive After=multi-user.target
[Service] Type=idle Environment="HIVE_SECRET_KEY=blahblahblah" User=myusername Group=myusername
WorkingDirectory=/opt/graylog2thehive ExecStart=/usr/bin/python3 app.py runserver
StandardOutput=journal
StandardError=journal
[Install] WantedBy=multi-user.target root@thehive:/opt/graylog2thehive# root@thehive:/opt/graylog2thehive#cp init.d/graylog2thehive.service /etc/systemd/system/graylog2thehive.service
Change the requirements file to look like this, and run the pip update (if needed, apt install python3-pip):
thehive4py==1.6.0 requests #json #logging flask
root@thehive:/opt/graylog2thehive# pip install -r requirements.txt
Then tell linux the world has changed, and start your service.
root@thehive:/opt/graylog2thehive# systemctl daemon-reload root@thehive:/opt/graylog2thehive# systemctl enable graylog2thehive.service root@thehive:/opt/graylog2thehive# systemctl start graylog2thehive.service