Its possibly been posted here already but I finally managed to setup x10 running correctly as a service on the Raspberry Pi using the CM15a/CM15Pro controller and Mochad. This probably applies to other flavours of linux too.I previously used an entry in the rc.local file but this is no longer working properly in Raspbian Jessie as far as I can see

Firstly you need to create a Mochad service using the Systemd.

sudo nano /usr/lib/systemd/system/mochad.service

Enter the following code in the editor

Description=Mochad X10 Daemon



Save this file. Now change the udev rule to start the mochad service instead of trying to start the mochad process directly.

SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0bc7", ATTR{idProduct}=="0001", RUN+="/bin/systemctl --no-block start moch$
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0bc7", ATTR{idProduct}=="0002", RUN+="/bin/systemctl --no-block start moch$

Save this file. Now you need to enable the new Mochad service just once to have it start on every reboot.

sudo systemctl enable mochad.service

That should keep the Mochad service running on the Raspberry Pi without stopping.

I hope this is of help to anyone.