[systemd-devel] systemd + ExecStart + python script

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Nov 12 09:40:34 PST 2013


On Tue, Nov 12, 2013 at 06:14:30PM +0100, Abdelghani Ouchabane wrote:
> On 11/11/13 17:32, Zbigniew Jędrzejewski-Szmek wrote:
> >On Mon, Nov 11, 2013 at 04:55:05PM +0100, Abdelghani Ouchabane wrote:
> >>ExecStart=/usr/bin/python /opt/cyclades/bin/t_idl.pyo
> >>            |-1377 /bin/sh -c if [ ! -e
> >>/home/x/taskconfig/screensaver ]; then /bin/mkdir -p
> >>/home/x/taskconfig ;                        /bin/cp
> >>/opt/cyclades/etc/taskconfig/screensaver
> >>/home/x/taskconfig/screensaver ;                        fi ;
> >>/bin/echo -n $BASHPID > /var/tmp/cyclades_services/IDL/pid ;
> >>DISPLAY=:0 CYCLADES_ERR=IDL /opt/cyclades/bin/logger.sh -c
> >>"/usr/bin/python /opt/cyclades/bin/t_idl.pyo" -p err -t IDL
> >Those two don't correspond. Either you're starting the program
> >directly, or through some shell scripts. It would help if you
> >showed the two unit files.
> >
> >Zbyszek
> >
> >
> Hallo Zbyszek,
>   I modified the unit to start the main program as:
> 
> 1- ExecStart=/bin/sh -c 'DISPLAY=:0 /usr/bin/python
> /opt/cyclades/bin/t_idl.pyo'
Try something simpler:

Environment=DISPLAY=:0
ExecStart=/usr/bin/python /opt/cyclades/bin/t_idl.pyo

Anyway, it seems that the script either exits (maybe some error?) or
daemonizes itself.  If it's not failing to start with an error, you
probably need to change (starting from the snippet I put above) to
Type=forking, or make the script not exit.

Zbyszek


More information about the systemd-devel mailing list