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

set as service on startup #26

Open
alexeinz opened this issue Jul 30, 2018 · 4 comments
Open

set as service on startup #26

alexeinz opened this issue Jul 30, 2018 · 4 comments

Comments

@alexeinz
Copy link

  • Python Alexa Voice Service version: avs2, latest

Description

I want to set Alexa to start automatically on startup ( using pocketsphinx)

What I Did

Alexa runs fine if executed manually
Added start command into rc.local but it is not starting
What is the correct way to set it as startup service

mopidy and shairport are stopped and disable, this will only be used as alexa

@alexeinz
Copy link
Author

installed python-daemon and did following changes to alexa script
/usr/bin/python2.7

-- coding: utf-8 --

import daemon
import re
import sys

from avs.main import main

def run():
with daemon.DaemonContext():
sys.argv[0] = re.sub(r'(-script.pyw|.exe)?$', '', sys.argv[0])
sys.exit(main())

if name == 'main':
run()

@alexeinz
Copy link
Author

Now I added it as S99 service but it does not start at boot....
absolutely no problem when i run command manually....
is there any thing else i need to do besides running enable command?

@xiongyihui
Copy link
Contributor

How about adding the command to /root/autorun.sh. Maybe add some delays to wait the sound card is ready.

@Tonemon
Copy link

Tonemon commented Mar 19, 2019

How about adding the command to /root/autorun.sh. Maybe add some delays to wait the sound card is ready.

Hi, I am trying to add the alexa command (alexa start) to the boot options with a delay (sleep 30) as you mentioned above, but it doesn't work. Alexa runs fine when triggered manually, but I can't get it to start at boot.

Is it possible that it only works when you have a terminal window open and the service (alexa start) started? I think this could be the reason why it's not working, because every time I close the window the service stops. Could someone help me with this?

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

3 participants