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

Systemd service does not work after reboot #132

Closed
6 of 9 tasks
scharrin2 opened this issue Mar 6, 2019 · 3 comments
Closed
6 of 9 tasks

Systemd service does not work after reboot #132

scharrin2 opened this issue Mar 6, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@scharrin2
Copy link

Put an x into all the boxes [ ] relevant to your issue (like this: [x])

What is the purpose of your issue?

  • Bug report (encountered problems with amazon-dash)
  • Feature request (request for a new functionality)
  • Question
  • Other

Guideline for bug reports

You can delete this section if your report is not a bug

  • amazon-dash version: v1.3.2
  • Python version: 2.7.13
  • Pip & Setuptools version: pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
  • Operating System: Raspbian GNU/Linux 9 (stretch)

How to get your version:

amazon-dash --version
python --version
pip --version
easy_install --version
  • The pip install or setup install command has been completed without errors
  • The python -m amazon_dash.install command has been completed without errors
  • The amazon-dash discovery command works without errors
  • I have created/edited the configuration file
  • Amazon-dash service or amazon-dash --debug run works

Description

I setup the autostart Smith the commands
sudo systemctl start amazon-dash

After a reboot I can see that the amazon-dash is running

pi@servberry:~ $ sudo systemctl status amazon-dash
● amazon-dash.service - Amazon Dash service
Loaded: loaded (/lib/systemd/system/amazon-dash.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-03-06 19:40:31 CET; 1min 2s ago
Main PID: 330 (amazon-dash)
CGroup: /system.slice/amazon-dash.service
└─330 /usr/bin/python /usr/local/bin/amazon-dash run --config /etc/amazon-dash.yml

Mar 06 19:40:31 servberry systemd[1]: Started Amazon Dash service.
Mar 06 19:40:32 servberry env[330]: Welcome to Amazon-dash v1.3.2 using Python 2.7.13
Mar 06 19:40:32 servberry env[330]: Listening for events. Amazon-dash will execute the events associated with the r
lines 1-10/10 (END)

But when I press the button on the Dash button, nothing happens.

What I Did

When restarting the amazon-dash with the command

sudo systemctl restart amazon-dash

the Dash-Button works

@scharrin2 scharrin2 changed the title No function in systemd mode No function after reboot Mar 6, 2019
@Nekmo
Copy link
Owner

Nekmo commented Mar 8, 2019

Maybe amazon-dash should wait for the network to be available to start. Include this in your amazon-dash.service:

After=network-online.target
Wants=network-online.target

And reload daemons:

systemctl daemon-reload

@Nekmo Nekmo self-assigned this Mar 8, 2019
@Nekmo Nekmo added the bug label Mar 8, 2019
@scharrin2
Copy link
Author

Yes - now it works.

I put the two lines in the [Unit] section:

[Unit]
Description=Amazon Dash service
After=network-online.target
Wants=network-online.target

[Service]
User=root
ExecStart=/usr/bin/env amazon-dash run --config /etc/amazon-dash.yml
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Best regards,
Christian

@Nekmo
Copy link
Owner

Nekmo commented Mar 9, 2019

Thanks :) I will add this change to the next release.

@Nekmo Nekmo changed the title No function after reboot Systemd service does not work after reboot Mar 11, 2019
@Nekmo Nekmo added this to the v1.3.3 milestone Mar 11, 2019
@Nekmo Nekmo closed this as completed Mar 11, 2019
@Nekmo Nekmo modified the milestones: v1.3.3, v1.4.0 Mar 22, 2019
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

2 participants