Jump to content

Search the Community

Showing results for tags 'systemd'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Deutsch
    • Allgemeine Diskussionen
    • Anfängerfragen und FAQ
    • Software, Programmierung und externe Tools
    • Hardware
    • Projektvorstellungen und Projektideen
    • WARP Charger
  • English
    • General Discussion
    • Project introductions and project ideas

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

Found 1 result

  1. Hello, I want to run a python script 24/7. I am using systemd service and it looks like this: [Unit] Description= start code After=multi-user.target [Service] Type=simple ExecStart= /usr/bin/python3 /home/pi3/code1.py Restart=on-abort [Install] WantedBy=multi-user.target When I enabled the systemd service it was running without error. but after few hours it stopped. I got the following error. ● codestart.service - start code Loaded: loaded (/lib/systemd/system/codestart.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2022-06-07 16:13:15 CEST; 20h ago Process: 859 ExecStart=/usr/bin/python3 /home/pi3/code1.py (code=exited, status=1/FAILURE) Main PID: 859 (code=exited, status=1/FAILURE) CPU: 1.086s Jun 07 16:13:15 raspberrypi python3[859]: File "/home/pi3/code1.py", line 54, in main Jun 07 16:13:15 raspberrypi python3[859]: ipcon.connect(HOST, PORT) Jun 07 16:13:15 raspberrypi python3[859]: File "/usr/local/lib/python3.9/dist-packages/tinkerforge/ip_connection.py", lin> Jun 07 16:13:15 raspberrypi python3[859]: self.connect_unlocked(False) Jun 07 16:13:15 raspberrypi python3[859]: File "/usr/local/lib/python3.9/dist-packages/tinkerforge/ip_connection.py", lin> Jun 07 16:13:15 raspberrypi python3[859]: tmp.connect((self.host, self.port)) Jun 07 16:13:15 raspberrypi python3[859]: OSError: [Errno 101] Network is unreachable Jun 07 16:13:15 raspberrypi systemd[1]: codestart.service: Main process exited, code=exited, status=1/FAILURE Jun 07 16:13:15 raspberrypi systemd[1]: codestart.service: Failed with result 'exit-code'. Jun 07 16:13:15 raspberrypi systemd[1]: codestart.service: Consumed 1.086s CPU time. ~ Can you please suggest what should I do to restart the code in case of network failure? Thanks
×
×
  • Create New...