I want to run a code at startup but I am getting this error below. The script works when running in python, but I am unsure how to allocate permissions or where to make a path to the pxcore.so file so this startup service will work. If anyone can help, I would greatly appreciate it.

sudo systemctl status autodetect.service
● autodetect.service - Auto Detect Service
Loaded: loaded (/lib/systemd/system/autodetect.service; enabled)
Active: failed (Result: signal) since Tue 2017-06-13 20:21:21 CDT; 10s ago
Process: 1145 ExecStart=/usr/bin/python /home/pi/pixetrpi/autodetect.py  (code=killed, signal=SEGV)
Main PID: 1145 (code=killed, signal=SEGV)

Jun 13 20:21:21 raspberrypi systemd[1]: Started Auto Detect Service.
Jun 13 20:21:21 raspberrypi python[1145]: Cannot load library  "./pxcore.so": ./pxcore.so: cannot open shared object file: No such fi...rectory
Jun 13 20:21:21 raspberrypi systemd[1]: autodetect.service: main process exited, code=killed, status=11/SEGV
Jun 13 20:21:21 raspberrypi systemd[1]: Unit autodetect.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

The service I have created is:

Description= Auto Detect Service

ExecStart=/usr/bin/python /home/pi/pixetrpi/autodetect.py


Which runs this autodetect.py script I created:

import pypixet

from time import sleep

import acquisition_example

def autodetect(pixet):
devices = pixet.devices()

while str(type(devices[0])) != "<type 'IDevMpx2'>":
    devices = pixet.devices()
return pixet.devices().pop()

if __name__ == "__main__":
device = autodetect(acquisition_example.pixet)
print("Discovered minipix!")
  • 1
    You have to know where pxcore.so is located. Where is it with full path? – Ingo Feb 16 at 11:01

I think your issue could be that you have multiple versions of python (just talking by experience, might be wrong).

I had similar issues in the past with python/systemctl, you should try to include something like #!/usr/bin/python. This way you tell the service running the script, which interpreter to use and where to find it. This question talks a little about shebang lines, if you want more info on this:


I'm not 100% sure this will fix it, but i think you should give it a try, since for example the version of python used by your systemctl service to run your script, may not have that library installed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.