Re: Help needed with systemd script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried to run without the "sleep" command, it fails:
# systemctl start boinc-client.service
Job for boinc-client.service failed. See 'systemctl status boinc-client.service' and 'journalctl -xn' for details.
[root@deneb marvin]# systemctl status boinc-client.service --full
boinc-client.service - Berkeley Open Infrastructure Network Computing Client
   Loaded: loaded (/usr/lib/systemd/system/boinc-client.service; disabled)
   Active: failed (Result: exit-code) since sab 2013-12-14 15:24:30 CET; 11s ago
  Process: 3613 ExecStartPre=/usr/bin/xhost +SI:localuser:boinc (code=exited, status=1/FAILURE)
  Process: 3610 ExecStartPre=/usr/bin/chown boinc:boinc /var/log/boinc.log /var/log/boincerr.log (code=exited, status=0/SUCCESS)
  Process: 3608 ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boincerr.log (code=exited, status=0/SUCCESS)
  Process: 3604 ExecStartPre=/bin/sleep 1 (code=exited, status=0/SUCCESS)

dic 14 15:24:30 deneb systemd[1]: boinc-client.service: control process exited, code=exited status=1
dic 14 15:24:30 deneb systemd[1]: Failed to start Berkeley Open Infrastructure Network Computing Client.
dic 14 15:24:30 deneb systemd[1]: Unit boinc-client.service entered failed state.


Il 14/12/2013 15:13, Dridi Boukelmoune ha scritto:

This time it's the sleep command that will override the xhost exit
status. Since you're running xhost in foreground, you shoudn't need to
sleep at all.

In general, if you have several commands in a script, but you want it
to abort as soon as one command fail, you can:
- run it with sh -e
- add set -e in your script

This is a one-command script, so you can simply run xhost, and the
shell exit status should be xhost's exit status. Btw, do you really
need a script ? Can't systemd handle something like:
ExecStartPre=/usr/bin/xhost +SI:localuser:boinc



-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux