inputexec icon indicating copy to clipboard operation
inputexec copied to clipboard

Run inputexec as service

Open vrs01 opened this issue 7 years ago • 3 comments

Hi!

I want to run inputexec as service so I set up a systemd service like this in /etc/systemd/system/[email protected]

[Unit]
Description=Home Assistant
After=network.target

[Service]
Type=simple
User=%i
Environment='config=--config /home/pi/inputexec/scripts/config.ini'
ExecStart=/usr/local/bin/inputexec $config

[Install]
WantedBy=multi-user.target

When I start the service, I only get:

[email protected] - Inputexec
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled)
   Active: inactive (dead) since Thu 2017-06-15 23:20:43 CEST; 7s ago
  Process: 1398 ExecStart=/usr/local/bin/inputexec $config (code=exited, status=0/SUCCESS)
 Main PID: 1398 (code=exited, status=0/SUCCESS)

Jun 15 23:20:43 raspberrypi_wozi systemd[1]: Started Inputexec.

with a grey bullet point. inputexec runs nicely in the commandline with the user 'pi'. Do I have to set this up differently?

vrs01 avatar Jun 15 '17 21:06 vrs01

any idea on this? I tried starting inputexec at system boot with /etc/rc.local but it sometimes crashes. So a systemd service would be better.

vrs01 avatar Jul 26 '17 10:07 vrs01

This worked for me on Ubuntu:

[Unit]
Description=Process MCE commands
After=network.target

[Service]
ExecStart=/usr/local/bin/inputexec --action-commands=/home/mythtv/Documents/Scripts/inputexec-actions.ini --source-file=/dev/IntelCIR --action-mode=run_async --logging-target=syslog --logging-level=info
Restart=always

[Install]
WantedBy=multi-user.target

sfatula avatar Jul 06 '18 18:07 sfatula

I've never written systemd unit files, so I'm not sure how much I can help you there :(

However, the first one that was posted might have an issue when expanding the $config environment variable into a list of space-separated arguments.

If anyone has a proper and tested service file, I'd love to include it in the documentation :)

rbarrois avatar Jul 29 '18 14:07 rbarrois