I have created the service sendir.service and put it in /etc/systemd/system
This is what the service looks like:
[Unit]
Description=sendir
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/usr/local/bin/sendir
[Install]
WantedBy=multi-user.target
And this is the script for the service /usr/local/bin/sendir:
#!/bin/bash
irsend SEND_ONCE ph_remote KEY_POWER
When I try to enable the service via sudo systemctl enable sendir.service --now I'm getting this error message
Synchronizing state of sendir.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable sendir
update-rc.d: error: sendir Default-Start contains no runlevels, aborting.
Does anybody know what I'm doing wrong?
ExecStop=/usr/local/bin/sendir. It should be executed at every shutdown as you can see here. – jake Oct 09 '18 at 01:00/usr/local/bin/sendiris the Bash script he shows. Perhaps then thesendirfile just needs to include theBEGIN INIT INFO. I'll edit the question to show the name of the Bash script. – HeatfanJohn Oct 09 '18 at 14:39ExecStop=/bin/bash irsend SEND_ONCE ph_remote KEY_POWER. What do you think? – jake Oct 09 '18 at 14:54BEGIN INIT INFOto the script and also put the command like @jake mentioned directly in the service. Bot I got the exact same error message again, when I try to enable the service. Can it be that somethings is wrong with the service file itself? – apfelcast Oct 09 '18 at 18:38