hondagx35 wroteHi,
as tux already mentioned you have to use systemd:
- save your script in "/usr/bin/" for example "/usr/bin/turn_off_hdmi.sh"
- make it executable
- write a unit-file in "/usr/lib/systemd/system/" for example "/usr/lib/systemd/system/disable_hdmi.service"
[Unit]
Description=Turns off the hdmi-port
Requires=
After=
[Service]
Type=forking
ExecStart=/usr/bin/turn_off_hdmi.sh
TimeoutSec=0
[Install]
WantedBy=multi-user.target
- start it for testing
"systemctl start disable_hdmi.service"
- then enable it
"systemctl enable disable_hdmi.service"
After next reboot it should start automatically.
Frank
Thank Frank.
I tried doing what you suggested.
I ran the file turn_off_hdmi.sh and everything works, the TV goes off .
I created a unit-file as your display and I tried to run it with "systemctl start disable_hdmi.service" but this is the result:
Job for disable_hdmi.service failed. See 'systemctl status disable_hdmi.service' and 'journal ctl -xn ' for details .
I launched 'systemctl status disable_hdmi.service' and this is the output:
* Disable_hdmi.service - Turns off the HDMI -port
Loaded: loaded ( /usr/lib/systemd/system/disable_hdmi.service ; disabled)
Active : failed ( Result : exit -code) since Mon 10/11/2014 21:37:34 CET ; August 4min 26s
Process: 732 ExecStart = / usr / bin / turn_off_hdmi.sh ( code = exited , status = 203 / EXEC)
And when I launched 'journal ctl -xn' I got this :
-bash : journal : command not found
Do you have any other suggestions to solve these problems?
Since the .sh file does its job, I guess it's a problem of systemd, but I do not know what to do ...
Thanks for your help.