Page 1 of 1

init.d boot script no longer loaded at boot?

Posted: Wed Nov 23, 2016 6:05 am
by diracsbracket
Hi,
I have a simple init.d bootscript that runs a python script checking if the shutdown button on my Pi (via GPIO)
was pressed, and if so, sends a signal on another GPIO to cut the power to my Pi, once it is safe to do so.

It used to work with my previous Raspbian installation, but after I updated to the latest Raspbian image, 4.4.21-v7,
it no longer works.

If I start the service manually though after boot, it works correctly.

I put the script in /etc/init.d/myscript and chmod 755 it. start/stop all work when done manually.
I also did update-rc.d myscript defaults.

Yet after reboot, it does not work (although it previously did, with the previous raspbian image)

Has anything changed in the latest Raspbian release? Should I use a systemd unit file instead from now on?

Thanks for your feedback!

Re: init.d boot script no longer loaded at boot?

Posted: Wed Nov 23, 2016 6:48 am
by diracsbracket
FYI.
I replaced the init.d script by a systemd unit file, and it works correctly.
I'll stick with using systemd from now on.

The explanation why my init.d script accessing GPIO via python does not work may be as explained here:
http://www.raspberrypi-spy.co.uk/2015/1 ... g-systemd/
The link also explains how to create the systemd unit file.
Cheers.