mochad systemd does not start

Problems with packages? Post here, using [tags] of the package name.

mochad systemd does not start

Postby woody » Sat Jun 08, 2013 9:27 pm

I'm running mochad 0.1.15-2 on a Pogoplug V2. Everything is working ok except:

1. mochad does not start on reboot (but it does start if I unplug the USB and plug it back in again).

2. I tried to enable the systemd service for mochad, using the mochad.service file provided by WarheadsSE. I get errors when I try to start or enable systemd using that file.

So, I'm looking for a way to make sure that mochad will restart on reboot. Does anybody know what I need to do?
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm

Re: mochad systemd does not start

Postby WarheadsSE » Sun Jun 09, 2013 9:47 pm

Looking at the file as I see it on my system now, it admittedly does not have all the bits that appear necessary for running at start.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: mochad systemd does not start

Postby woody » Mon Jun 10, 2013 4:44 pm

$this->bbcode_second_pass_quote('WarheadsSE', 'L')ooking at the file as I see it on my system now, it admittedly does not have all the bits that appear necessary for running at start.


I can't get it to start or enable. In other words, the systemd config file doesn't seem to work at all. Can you give me any direction on what needs to be changed to get it to work?
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm

Re: mochad systemd does not start

Postby sdjf » Sun Jul 07, 2013 10:24 pm

Writing systemd service files can be a challenge, and the documentation not easy to follow unless you are an expert.

I think your best bet is to copy a service file that you know works, and modify the contents to fit your application.

In some cases, systemd service won't work because some device has to be seen before they will. It may be possible to get them to wait for that, but I found in that instance, that a udev rule works better. System watches for a device to be recognized, and then runs whatever you want to have run.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: mochad systemd does not start

Postby WarheadsSE » Mon Jul 08, 2013 12:51 pm

Also, check if it has a udev rule to start it @ detection/insertion
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: mochad systemd does not start

Postby woody » Mon Jul 08, 2013 7:42 pm

I do have a udev rule for it and it does start when I plug it in. Unfortunately, it does not start up on a reboot which is a problem when the power fails. I will see if I can figure out how to get systemd to work.
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm

Re: mochad systemd does not start

Postby WarheadsSE » Mon Jul 08, 2013 8:33 pm

Ah, I see. Admittedly I haven't messed with mine much in the last while.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: mochad systemd does not start

Postby woody » Thu Aug 08, 2013 9:08 pm

I have been experimenting with a systemd file for mochad and this one seems to work most of the time:

$this->bbcode_second_pass_code('', '[[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')

I had one reboot where mochad crashed. I don't know exactly why that one crashed, but, as a precaution, I removed the udev auto-start rule in case that was causing a conflict.

Notice that this service file uses 'GuessMainPID='. I had to do this because it would not start properly when using the more typical option of specifying Pidfile=. It appears that the way the application is written that it doesn't allow systemd to specify the pid.

This is really an experimental hack on my part, so if anybody knows a way to improve this service file, please post it.
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm


Return to Packages

Who is online

Users browsing this forum: No registered users and 15 guests