Start python script on Boot (rasp3 model b - openHAB 2.5.0~M1-1 (Milestone Build))

(david) #1

So I tried everything and i am thinging if there is some difficulty because we run openhabian on rasp3 model b.
So I want to run a script to enable the fan in order to cool rasp cpu at boot.

the script is running perfect manually .NAME: run-fan.py . I placed it to folder ./fan/run-fan.py
then
Via Putty
$ sudo chmod +x ./fan/run-fan.py (without error)
$ cd /etc/init.d
$ sudo nano

#!/bin/sh
### BEGIN INIT INFO
# Provides: run-fan.py
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start fan script at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
python .fan/run-fan.py

saved with the name “fan”
$ cd
$ sudo update-rc.d fan defaults (without error)

What i am doing wrong?

0 Likes

(Rich Koshak) #2

Raspbian hasn’t used init.d for sure some time. You need to search for systemd tutorials and examples.

1 Like

(david) #3

systemd worked. thnx

0 Likes