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

about systemd service definition #74

Open
ffllc opened this issue Sep 13, 2019 · 3 comments
Open

about systemd service definition #74

ffllc opened this issue Sep 13, 2019 · 3 comments

Comments

@ffllc
Copy link

ffllc commented Sep 13, 2019

Hi, i am a new user.
I dont know how to set tesla-apiscraper for auto start after debian boot.
I hope someone can help me. Thanks.
I had test set a systemd service but it show Error

root@Debian:~# sudo systemctl status tesla.service

  • tesla.service - Tesla Service
    Loaded: loaded (/lib/systemd/system/tesla.service; enabled; vendor preset: en
    Active: failed (Result: exit-code) since Fri 2019-09-13 06:09:06 UTC; 29s ago
    Process: 1174 ExecStart=/usr/bin/python3 apiscraper.py (code=exited, status=1/
    Main PID: 1174 (code=exited, status=1/FAILURE)

Sep 13 06:09:05 Debian systemd[1]: Started Tesla Service.
Sep 13 06:09:06 Debian python3[1174]: Failed to initialize Owner API
Sep 13 06:09:06 Debian systemd[1]: tesla.service: Main process exited, code=exit
Sep 13 06:09:06 Debian systemd[1]: tesla.service: Unit entered failed state.
Sep 13 06:09:06 Debian systemd[1]: tesla.service: Failed with result 'exit-code'
lines 1-11/11 (END)

my service is:

[Unit]
Description=Tesla Service
After=multi-user.target

[Service]
Type=idle
WorkingDirectory=/tesla-apiscraper
ExecStart=/usr/bin/python3 apiscraper.py

[Install]
WantedBy=multi-user.target

@lephisto
Copy link
Owner

Does the Service work if you start it manually?

@egonzalezpozega
Copy link

egonzalezpozega commented Nov 16, 2019

This one works for me on a debian based distro (armbian):

[Unit]
Description=Tesla Api Scraper
After=network.target
[Service]
Type=simple
User=bananapi
Group=bananapi
ExecStart=python3 /home/bananapi/tesla-apiscraper/apiscraper.py
Restart=always
Users=bananapi
WorkingDirectory=/home/bananapi/tesla-apiscraper
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target

@rtega
Copy link

rtega commented Nov 29, 2019

Be careful to start it AFTER influxdb has started or it will exit immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants