pimoroni / clean-shutdown

Python daemon to watch a GPIO pin and trigger a clean shutdown.
MIT License
125 stars 40 forks source link

init.d typo prohibits easy systemctl tabbing #28

Closed rimeraz closed 3 years ago

rimeraz commented 3 years ago

I tried to tab-complete after typing systemctl status clea and it completed only until cleanshu. Double-tab resulted in:

root@myhost:~# systemctl status cleanshu
cleanshud.service   cleanshutd.service
root@myhost:~# 

cleanshud.service is nowhere defined. It results from the typo in line 3 of daemon/etc/init.d/cleanshutd:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          cleanshud

Actually it should read:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          cleanshutd

After adding the missing t and systemctl daemon-reload the systemctl status clea will tab-complete as expected.

pirateradiohack commented 3 years ago

I can see that Systemd creates 2 services as well, cleanshud.service and cleanshutd.service.

I have created the pull request https://github.com/pimoroni/clean-shutdown/pull/30 in order to fix it.

Gadgetoid commented 3 years ago

D'oh! Thank you.