I wanted to write my own program using python and keep it running at all times, so I tried to service it using Systemd, but when I started the service, I usually get some error. There are errors due to permissions and errors that the gpiozero module does not exist. The worst syslog may not show any details and only
zishin.service: Main process exited, code = exited, status = 203/EXEC. When run as a service, you will encounter various errors, but when you debug withvscode, no errors will occur.
The unit file is as follows.
[Unit] Description = zishinmonitor After = multi-user.target [Service] ExecStart =/usr/bin/python3 /home/pi/Git/zishinMonitor/main.py Type = simple [Install] WantedBy = multi-user.target
Is there anything I should be aware of when creating a service for my program?
Answer # 1
I didn't mention it in the question, but when I run it as a service, the working directory is not set to
\, and as a workaround, I added RootDirectory to the unit file and specified the working directory. After careful examination, the working directory was specified as WorkingDirectory. I tried to specify the WorkingDirectory before, but I thought it was wrong because the working directory was not changed well, but the cause was another part of the unit file. The module is said not to exist because if RootDirectory is set to
/home/pi/Git/zishinMonitor, directories above its parent are ignored.
Since the question was asked while the causal relationship of the problem that occurred was confused, the question became very difficult to understand. Excuse me.
Answer # 2
Is the environment variable PATH different or is there no standard input/output?
- python max () arg is an empty sequence and an error occurs and it cannot be processed well
- python: an error occurs that the type is different in the output using dict key values
- java - i want to resolve an error that occurs when running a spring application
- python - an error occurs in the if statement program that compares the size of numbers
- python - an error occurs when django's summer note is reflected in admin
- python - error running flask in terminal
- python 3x - an error occurs after registering a dictionary with a read-aloud bot on discordpy
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- error when running python setuppy install
- python - how to resolve attribute error
- indent error doesn't go away, python
- python - sklearn, svm error
- python - error in image binarization using cv2adaptivethreshold function
- python - categorical_crossentoropy error does not resolve
- linux - buffer error on v4l2
- readcsv error in python
- python - i want to display an image with pysimplegui, but an error occurs
- python - error when scraping with selenium and firefox
- [python] graphviz output format error
- python - web scraping what to do when a webdriverexception occurs on starbucks hp
- linux : What should I do if a question mark is displayed in ls?
- Wordpress query on MyISAM tables in MariaDB on ZFS takes too long to execute
- linux : Managing startup services in WSL Debian
- linux : The script does not work under cron
- linux - it was cool in x window, but i got an error when i ran it from ssh usb qr code reader
- when using apache external media as the document root, it becomes 403 forbidden
- linux - i want to disable ipv6 in armbian 2011 buster
- linux - serial port on raspberry pi
- linux - output to a file line by line after processing with for in
- i want to output multiple lines of html code using python