Ask Your Question

Revision history [back]

Getting error running systemd service in Fedora 26.

I am trying to start the following command on boot "xinput set-prop 13 289 1"

I created a systemd service called reversemouse.service

When I try to run it I get the following error:

[brandon@localhost ~]$ sudo systemctl status reversemouse.service ‚óŹ reversemouse.service - Description of the systemd service Loaded: loaded (/etc/systemd/system/reversemouse.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2017-07-17 21:11:51 EDT; 4s ago Process: 2863 ExecStart=/usr/bin/sh -c xinput set-prop 13 289 1 (code=exited, status=1/FAILURE) Main PID: 2863 (code=exited, status=1/FAILURE)

Jul 17 21:11:51 localhost.localdomain systemd[1]: Starting Description of the systemd service... Jul 17 21:11:51 localhost.localdomain sh[2863]: Unable to connect to X server Jul 17 21:11:51 localhost.localdomain systemd[1]: reversemouse.service: Main process exited, code=exited, sta Jul 17 21:11:51 localhost.localdomain systemd[1]: Failed to start Description of the systemd service. Jul 17 21:11:51 localhost.localdomain systemd[1]: reversemouse.service: Unit entered failed state. Jul 17 21:11:51 localhost.localdomain systemd[1]: reversemouse.service: Failed with result 'exit-code'. Do you know what this error means, did I format the systemd service correctly? Here is my systemd service:

[Unit] Description=Description of the systemd service

[Service] Type=oneshot ExecStart=/usr/bin/sh -c "xinput set-prop 13 289 1"

[Install] WantedBy=default.target Excuse my noobness. Thanks!