Page 1 of 1

systemd service causing stop job hangup dhcpcd on all interfaces on shutdown

Posted: Thu Jun 27, 2019 12:55 am
by hilts50
I am working on a project with neopixels and currently trying to get the LED's to shut off when the pi is shutdown/rebooted. Im working on a systemd service file that will call a shell script to run a python script during the shutdown/reboot sequence. It works for the most part, but on some of the reboot / shutdown requests the pi freezes up and give me the following error.
a stop job is running for dhcpcd on all interfaces
Im running

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
Pi 3B+

The code I am using in the service file is as follows.

Code: Select all

[Unit]
Description=Turns off LED's on shutdown.


[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/home/pi/scripts/shutoff.sh

[Install]
WantedBy=multi-user.target


Re: systemd service causing stop job hangup dhcpcd on all interfaces on shutdown

Posted: Sat Jun 29, 2019 2:39 am
by hilts50
After fighting with this for a while, I just started over with a wipe of the SD card a fresh install of the lasts release and it is working fine with the following code.

Code: Select all

[Unit]
Description=Turns off LED's on shutdown.
After=network.target


[Service]
Type=simple
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/usr/local/bin/shutoff.sh

[Install]
WantedBy=multi-user.target