Mochad on Arch not starting correctly with uDev

Just throwing this out here to see if anyone has experienced this and found a solution?

I am running Mochad on a Pogo with ArchLinux. If I start Mochad manually it will work fine until the Pogo reboots or (and that is more common) until the USB has a disconnect/reconnect event for the CM15Pro on USB.
I can tell from testing that UDEV correctly sees the event and does (re)start Mochad, but it terminates shortly after being started. The problem this obviously causes is that I cannot rely on this solution, since it may go down at any moment without me noticing, unless I happen to be in the UI and see the red bar under the Mochad plugin…

Any help appreciated! :wink:

Hi,

I had a similar issue and figured it out. I’m posting what I did in-case someone stumbles across this thread looking for answers:

  1. get the mochad systemctl service configured and working using the information provided here: http://archlinuxarm.org/forum/viewtopic.php?f=15&t=5691

cat /usr/lib/systemd/system/mochad.service
[Unit]
Description=Mochad X10 Daemon
Requires=systemd-udevd.service
After=systemd-udevd.service

[Service]
Type=forking
GuessMainPID=yes
ExecStart=/usr/bin/mochad
Restart=on-abort

[Install]
WantedBy=multi-user.target

  1. change the udev rule to start the mochad service instead of trying to start the mochad process directly.

cat /etc/udev/rules.d/91-usb-x10-controllers.rules
SUBSYSTEM==“usb”, ATTR{idVendor}==“0bc7”, ATTR{idProduct}==“0001”, RUN+=“/usr/bin/systemctl start mochad”
SUBSYSTEM==“usb”, ATTR{idVendor}==“0bc7”, ATTR{idProduct}==“0002”, RUN+=“/usr/bin/systemctl start mochad”