Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Automatic Start Airsonos #137

Closed
grisu0816 opened this issue Mar 22, 2015 · 3 comments
Closed

Automatic Start Airsonos #137

grisu0816 opened this issue Mar 22, 2015 · 3 comments

Comments

@grisu0816
Copy link

Is it possible to start airsonos automatically on the pi start ? I don't now how !

@wboerhout
Copy link

put the following line in /etc/rc.local:

sudo -u root -i /path/to/airsonos

(lookup the correct path for airsonos with "whereis airsonos" or "which airsonos")

the -i makes sure that the process created for airsonos has the same environment setup as an interactive login, so all PATH info is correct.

@stephen
Copy link
Owner

stephen commented Aug 9, 2015

This isn't in the current scope of the project. Another solution: #197

@stephen stephen closed this as completed Aug 9, 2015
@rafaelsantander
Copy link

rafaelsantander commented Apr 23, 2016

to use crontab you need to make sure the node's path is explicitly called

A. find the location of airsonos script by executing which airsonos
B. set the node path explicitly on the first line
i.e.
emacs /usr/local/bin/airsonos

#!/usr/bin/env /usr/local/bin/node`

C. create the restart script :
emacs /tmp/keepAliveASonos.sh

copy this script in

#!/bin/sh
if ps -ef | grep -v grep | grep airsonos ; then
        echo "airsonos is running"
        exit 0
else
        /usr/local/bin/airsonos&
    echo "airsonos restarted"
        exit 0
fi

D. set the permissions : chmod 755 /tmp/keepAliveASonos.sh

E. setup your cron to execute every 5 min by doing the following

  • crontab -e
  • */5 * * * * /tmp/keepAliveASonos.sh > /tmp/asonosRestart.log

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

No branches or pull requests

4 participants