[systemd-devel] pyload.service
Colin Guthrie
gmane at colin.guthr.ie
Tue Nov 6 10:56:38 PST 2012
'Twas brillig, and Sw at g at 06/11/12 18:18 did gyre and gimble:
>
> On 06/11/12 09:41, Colin Guthrie wrote:
>> 'Twas brillig, and Sw at g at 05/11/12 15:19 did gyre and gimble:
>>> Dear all,
>>>
>>> As a Archlinux user which adopted systemd for the best, I moved my
>>> system to it. I follow the wiki to start pyLoad as a service creating
>>> the following file:
>>> /etc/systemd/system/pyload.service (sweetth being my user)
>> snip.
>>
>>> PIDFile=/run/pyload/pyload.pid
>>> User=sweetth
>> The problem here is likely that your user is not able to write in the
>> /run/pyload folder in order to write the pid file and systemd will start
>> the service, wait for the pidfile to appear and when it never shows up,
>> kill the service again after a timeout.
>>
>> Simply create a tmpfiles.d snippet in /usr/lib/tmpfiles.d/pyload.conf
>> (or similar) with the following:
>>
>> d /run/pyload 0755 sweetth - -
>>
>>
>> That should make the folder owned by your user and the service should
>> startup fine (might need a reboot or running systemd-tmpfiles --create
>> manually)
>>
>> See man systemd-tmpfiles for more info.
>>
>> Col
>>
>>
> Dear Col,
>
> Many thanks for your input, I did create the file as your suggest and
> the folder /run/pyload belong to my user, however the service still crash.
>
> See below systemctl status:
>
> [sweetth at linuxbox ~]$ sudo systemctl status pyload.service
> pyload.service - Downloadtool for One-Click-Hoster written in python.
> Loaded: loaded (/etc/systemd/system/pyload.service; enabled)
> Active: failed (Result: timeout) since Tue, 2012-11-06 18:13:35
> GMT; 4min 53s ago
> Process: 359 ExecStart=/usr/bin/pyLoadCore --daemon (code=exited,
> status=0/SUCCESS)
> CGroup: name=systemd:/system/pyload.service
>
> Nov 06 18:12:32 linuxbox pyLoadCore[359]: Daemon PID 381
> Nov 06 18:13:35 linuxbox systemd[1]: Failed to start Downloadtool for
> One-Click-Hoster written in python..
> Nov 06 18:13:35 linuxbox systemd[1]: Unit pyload.service entered failed
> state
>
> Looking forward for your reply
The result of the failure is still timeout so it looks like it's still
failing to create the specified pid file.
You should check the code of the actual service itself (e.g.
/usr/bin/pyLoadCore and double check that the pidfile location is
correct. e.g. perhaps it's trying to create it's pidfile in
/run/pyload.pid directly rather than in the subfolder. It's maybe just a
small missing argument.
When you call "systemctl start pyload.service" on the command line, it
should block for a few minutes as it tries to start your service. You
can verify this with simple ps aux in another terminal. When no pid
file is found after the timeout the pid (381 in the above case) will be
killed and the initial systemctl start command will return control to
the shell.
It should be easy enough to work out where the pid file is kept or
configure it accordingly to put it in the place you want and make the
necessary tweaks.
There is also the chance that you copied your unit from elsewhere and,
infact, the pyload code does not actually create or use pidfiles at all.
If so then you should remove this directive from your unit and perhaps
use a different approach (perhaps using GuessMainPID= directive?)
Hope this helps point you in the right direction.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited http://www.tribalogic.net/
Open Source:
Mageia Contributor http://www.mageia.org/
PulseAudio Hacker http://www.pulseaudio.org/
Trac Hacker http://trac.edgewall.org/
More information about the systemd-devel
mailing list