I created a file myservice.service with the following content:
Code: Select all
[Unit]
Description=
After=network.target
[Service]
Type=simple
ExecStart=/bin/bash /usr/bin/touchpadoff.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
after I try to start the service and run: systemctl status myservice.service -l , I get the following message:
myservice.service
Loaded: loaded (/usr/lib/systemd/system/myservice.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sun 2019-06-09 17:59:21 EEST; 2s ago
Process: 17544 ExecStart=/bin/bash /usr/bin/touchpadoff.sh (code=exited, status=1/FAILURE)
Main PID: 17544 (code=exited, status=1/FAILURE)
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: Unit myservice.service entered failed state.
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: myservice.service failed.
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: myservice.service holdoff time over, scheduling restart.
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: Stopped myservice.service.
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: start request repeated too quickly for myservice.service
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: Failed to start myservice.service.
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: Unit myservice.service entered failed state.
Jun 09 17:59:21 192-168-0-100.rdsnet.ro systemd[1]: myservice.service failed.
Any ideas why it doesn't work? If I add exit 0 to the touchpadoff.sh e get rid of the error, but it still doesn't turn the touchpad off (and says something about not being able to connect to x server - not sure why it would need that)