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

Ubuntu - Autostart Service in Python Virtual Enviroment #256

Closed
Cleonardsmc opened this issue Jun 19, 2023 · 4 comments
Closed

Ubuntu - Autostart Service in Python Virtual Enviroment #256

Cleonardsmc opened this issue Jun 19, 2023 · 4 comments
Assignees
Labels

Comments

@Cleonardsmc
Copy link

Somewhat Linux Noob. Have everything configured including alerts to Gmail. Can't see to find a process for autostarting the Virtual environment and stating open canary on boot up of Linux Ubuntu.

Any guidance?

@hkelley
Copy link

hkelley commented Jun 20, 2023

I used the suggested service definition from #73.

[Unit]
Description=OpenCanary
After=syslog.target
After=network-online.target

[Service]
User=root
Type=simple
RemainAfterExit=yes
Restart=always
ExecStart=/root/env/bin/opencanaryd --start
ExecStop=/root/env/bin/opencanaryd --stop

[Install]
WantedBy=multi-user.target

@jayjb
Copy link
Contributor

jayjb commented Jun 21, 2023

Hi @Cleonardsmc,

Thanks for checking in with us. Lets see if we can get you up and running. As @hkelley (thanks!) has mentioned, for the autostart you can use a service file (as defined above).

The part there that you should be aware of is the pathing to opencanaryd.

As an example, lets say i created my virtual environment (using virtualenv or pyenv). Once I've activated the virtual environment and pip install opencanary, you should be able to see opencanaryd (is this possible in your setup?).

We can then go which opencanaryd to find the path to opencanaryd. Lets say I do

$ which opencanaryd
/home/ubuntu/Work/opencanaryenv/bin/opencanaryd

We would then use that output /home/ubuntu/Work/opencanaryenv/bin/opencanaryd in our service file for the:

ExecStart=/home/ubuntu/Work/opencanaryenv/bin/opencanaryd --start
ExecStop=/home/ubuntu/Work/opencanaryenv/bin/opencanaryd --stop

Otherwise please provide us with some more information about your setup so we can help further

@jayjb
Copy link
Contributor

jayjb commented Jul 31, 2023

Hi @Cleonardsmc,

Just wanted to check in and see if you got everything working?

@jayjb jayjb self-assigned this Jul 31, 2023
@jayjb jayjb added question and removed help wanted labels Aug 2, 2023
@jayjb
Copy link
Contributor

jayjb commented Aug 11, 2023

Closing this issue due to inactivity. Please feel free to reopen if you continue to have this issue.

@jayjb jayjb closed this as completed Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants