Startseite Foren Programmierung und Szenen Problem mit @reboot

Ansicht von 6 Beiträgen - 1 bis 6 (von insgesamt 6)
 SteMo 
Teilnehmer

Themen: 12

Antworten: 24

November 22, 2015 um 5:36 pm

Hallo,

ich brauche mal wieder Unterstützung von Experten.
Ich habe ein Python Skript welches beim booten gestartet werden soll. Leider klappt es nicht. Ich habe mich schon durch sämtliche Foren gekämpft, aber alle dort gefundenen Anleitungen klappen nicht.
Wenn ich mit SSH
python3 /home/email/alarm.py
eingebe startet das Skript wie erwartet.
Mit @reboot startet es aber nicht.
@reboot python /home/email/alarm.py
Und so auch nicht:
@reboot python3 /home/email/alarm.py

Eingetragen habe ich es mit
crontab -e
und auch mit sudo crontab -e
Mit chmod 755 habe ich die Rechte auf

-rwxr-xr-x 1 pi pi 7917 Nov 21 19:16 alarm.py

gestellt.

Wieso startet das Skript nicht beim booten.

Könnt ihr mir da helfen?

Gruß

Stefan

 SteMo 
Teilnehmer

Themen: 12

Antworten: 24

November 22, 2015 um 8:46 pm

noch ein Nachtrag.

Ich habe eine log Dateimit folgendem Inhalt. Leider kann ich damit nichts anfangen. Vielleicht sagt es Euch ja etwas.

http://192.168.178.27:8083
http://192.168.178.27:8083/ZAutomation/api/v1/login
Traceback (most recent call last):
File „/home/email/requests/packages/urllib3/connection.py“, line 135, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File „/home/email/requests/packages/urllib3/util/connection.py“, line 90, in create_connection
raise err
File „/home/email/requests/packages/urllib3/util/connection.py“, line 80, in create_connection
sock.connect(sa)
socket.error: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File „/home/email/requests/packages/urllib3/connectionpool.py“, line 559, in urlopen
body=body, headers=headers)
File „/home/email/requests/packages/urllib3/connectionpool.py“, line 353, in _make_request
conn.request(method, url, **httplib_request_kw)
File „/usr/lib/python3.2/http/client.py“, line 970, in request
self._send_request(method, url, body, headers)
File „/usr/lib/python3.2/http/client.py“, line 1008, in _send_request
self.endheaders(body)
File „/usr/lib/python3.2/http/client.py“, line 966, in endheaders
self._send_output(message_body)
File „/usr/lib/python3.2/http/client.py“, line 811, in _send_output
self.send(msg)
File „/usr/lib/python3.2/http/client.py“, line 749, in send
self.connect()
File „/home/email/requests/packages/urllib3/connection.py“, line 160, in connect
conn = self._new_conn()
File „/home/email/requests/packages/urllib3/connection.py“, line 144, in _new_conn
self, „Failed to establish a new connection: %s“ % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0xadaef0>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File „/home/email/requests/adapters.py“, line 376, in send
timeout=timeout
File „/home/email/requests/packages/urllib3/connectionpool.py“, line 609, in urlopen
_stacktrace=sys.exc_info()[2])
File „/home/email/requests/packages/urllib3/util/retry.py“, line 271, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’192.168.178.27′, port=8083): Max retries exceeded with url: /ZAutomation/api/v1/login (Caused by NewConnectionError(‚<requests.packages.urllib3.connection.HTTPConnection object at 0xadaef0>: Failed to establish a new connection: [Errno 101] Network is unreachable‘,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File „/home/email/alarm.py“, line 237, in <module>
zs.login()
File „/home/email/alarm.py“, line 99, in login
data=json.dumps(payload))
File „/home/email/requests/sessions.py“, line 511, in post
return self.request(‚POST‘, url, data=data, json=json, **kwargs)
File „/home/email/requests/sessions.py“, line 468, in request
resp = self.send(prep, **send_kwargs)
File „/home/email/requests/sessions.py“, line 576, in send
r = adapter.send(request, **kwargs)
File „/home/email/requests/adapters.py“, line 437, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=’192.168.178.27′, port=8083): Max retries exceeded with url: /ZAutomation/api/v1/login (Caused by NewConnectionError(‚<requests.packages.urllib3.connection.HTTPConnection object at 0xadaef0>: Failed to establish a new connection: [Errno 101] Network is unreachable‘,))
http://192.168.178.27:8083
http://192.168.178.27:8083/ZAutomation/api/v1/login
Traceback (most recent call last):
File „/home/email/alarm.py“, line 237, in <module>
zs.login()
File „/home/email/alarm.py“, line 99, in login
data=json.dumps(payload))
File „/home/email/requests/sessions.py“, line 511, in post
return self.request(‚POST‘, url, data=data, json=json, **kwargs)
File „/home/email/requests/sessions.py“, line 468, in request
resp = self.send(prep, **send_kwargs)
File „/home/email/requests/sessions.py“, line 576, in send
r = adapter.send(request, **kwargs)
File „/home/email/requests/adapters.py“, line 437, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=’192.168.178.27′, port=8083): Max retries exceeded with url: /ZAutomation/api/v1/login (Caused by NewConnectionError(‚<requests.packages.urllib3.connection.HTTPConnection object at 0x6c2050>: Failed to establish a new connection: [Errno 101] Network is unreachable‘,))
http://192.168.178.27:8083
http://192.168.178.27:8083/ZAutomation/api/v1/login
Traceback (most recent call last):
File „/home/email/requests/packages/urllib3/connection.py“, line 135, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File „/home/email/requests/packages/urllib3/util/connection.py“, line 90, in create_connection
raise err
File „/home/email/requests/packages/urllib3/util/connection.py“, line 80, in create_connection
sock.connect(sa)
socket.error: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File „/home/email/requests/packages/urllib3/connectionpool.py“, line 559, in urlopen
body=body, headers=headers)
File „/home/email/requests/packages/urllib3/connectionpool.py“, line 353, in _make_request
conn.request(method, url, **httplib_request_kw)
File „/usr/lib/python3.2/http/client.py“, line 970, in request
self._send_request(method, url, body, headers)
File „/usr/lib/python3.2/http/client.py“, line 1008, in _send_request
self.endheaders(body)
File „/usr/lib/python3.2/http/client.py“, line 966, in endheaders
self._send_output(message_body)
File „/usr/lib/python3.2/http/client.py“, line 811, in _send_output
self.send(msg)
File „/usr/lib/python3.2/http/client.py“, line 749, in send
self.connect()
File „/home/email/requests/packages/urllib3/connection.py“, line 160, in connect
conn = self._new_conn()
File „/home/email/requests/packages/urllib3/connection.py“, line 144, in _new_conn
self, „Failed to establish a new connection: %s“ % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x252def0>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File „/home/email/requests/adapters.py“, line 376, in send
timeout=timeout
File „/home/email/requests/packages/urllib3/connectionpool.py“, line 609, in urlopen
_stacktrace=sys.exc_info()[2])
File „/home/email/requests/packages/urllib3/util/retry.py“, line 271, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’192.168.178.27′, port=8083): Max retries exceeded with url: /ZAutomation/api/v1/login (Caused by NewConnectionError(‚<requests.packages.urllib3.connection.HTTPConnection object at 0x252def0>: Failed to establish a new connection: [Errno 101] Network is unreachable‘,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File „/home/email/alarm.py“, line 237, in <module>
zs.login()
File „/home/email/alarm.py“, line 99, in login
data=json.dumps(payload))
File „/home/email/requests/sessions.py“, line 511, in post
return self.request(‚POST‘, url, data=data, json=json, **kwargs)
File „/home/email/requests/sessions.py“, line 468, in request
resp = self.send(prep, **send_kwargs)
File „/home/email/requests/sessions.py“, line 576, in send
r = adapter.send(request, **kwargs)
File „/home/email/requests/adapters.py“, line 437, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=’192.168.178.27′, port=8083): Max retries exceeded with url: /ZAutomation/api/v1/login (Caused by NewConnectionError(‚<requests.packages.urllib3.connection.HTTPConnection object at 0x252def0>: Failed to establish a new connection: [Errno 101] Network is unreachable‘,))

Ich komme einfach nicht weiter

 SteMo 
Teilnehmer

Themen: 12

Antworten: 24

November 25, 2015 um 10:01 am

ich habe auf meinem Raspberry Pi 2 Wheezy installiert und per update „hoffentlich“ auf den letzten Stand gebracht. Zusätzlich natürlich noch ZWAY.

Das Python Programm soll nur beim booten gestartet werden und dann kontinuierlich laufen.

 SteMo 
Teilnehmer

Themen: 12

Antworten: 24

November 26, 2015 um 2:57 pm

herzlichen Dank an alle die mir hier geholfen haben. Ich habe mein Problemm jetzt wie folgt gelöst:

Ich habe das Skript mal jede Minute gestartet (0-59 * * * *), da lief es. Mit @reboot nicht. Grund war ein nicht vorhandenes Netzwerk. Das war beim Start des Skriptes noch nicht da.
Ich habe jetzt im Skript vor der Koppelung zum Netzwerk einfach einen sleep Befehl eingebaut. Jetzt klappts.

Ansicht von 6 Beiträgen - 1 bis 6 (von insgesamt 6)

Du musst angemeldet sein, um auf dieses Thema antworten zu können.