Open FuchsLo opened 4 years ago
I suppose Raspbian is using systemd now, so the provided init script wont help much. I've looked thru the forks and so far it seems no one has provided a systemd unit file :) I could write one blind but without the ability to test it wont make much sense and is likely not to work properly the first time.
Have a look at https://github.com/torfsen/python-systemd-tutorial
it shouldnt be too hard, and if it works for you, please send a PR or comment your unit file here and I'll add it into the lib/init folder.
I've done startup code by systemd service. You need to do below steps:
picoReflow.service
in /etc/sysemd/system
by command $ sudo nano picoReflow.service
if your username is pi
and picoReflow is installed in location /home/pi/picoReflow
you don't need to make any changes in code below.
put in file code:
[Unit]
#Human redable name of the unit
Description=picoReflow Service
[Service]
#Command to execute when the service is started
ExecStart=/usr/bin/python /home/pi/picoReflow/picoreflowd.py
[install]
WantedBy=default.target
$ sudo chown root:root picoReflow.service
$ sudo chmod 664 picoReflow.service
$ sudo systemctl enable /etc/systemd/system/picoReflow.service
sudo systemctl daemon-reload
$ sudo systemctl | grep picoReflow.service
You should get answer:
$ picoreflow.service loaded active running picoReflow Service
after reebot script should start automaticaly. Tested on RPI zero
<3 - thx for sharing
Hi dawstik, I try your solace, but I have this message:
.pi@raspberrypi:~/picoReflow $ sudo systemctl enable /etc/systemd/system/picoReflow.service The unit files have no installation config (WantedBy=, RequiredBy=, Also=, Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled using systemctl.
Can you help me please? Many thank's regards
it is ok now, I use command diretly on rc.local. thank's
I've tried with a lot of ways to make the server run when the pi is starting but nothing is working. I have a raspberry 3 with the Raspbian Buster Lite OS. The system is just for the oven and i exactly follow the commands, the oven is working well but its not starting when i boot the system.