[systemd-devel] Unit reported as failed despite exit code from SuccessExitStatus

Lennart Poettering lennart at poettering.net
Tue May 19 10:36:05 PDT 2015


On Thu, 16.04.15 14:21, Nikolaus Rath (Nikolaus at rath.org) wrote:

> On Apr 16 2015, Lennart Poettering <lennart at poettering.net> wrote:
> > On Wed, 15.04.15 22:45, Nikolaus Rath (Nikolaus at rath.org) wrote:
> >> I don't quite understand this:
> >> 
> >> $ systemctl --user status autocommit-org.service 
> >> ‚óŹ autocommit-org.service - Auto-commits changes to orgmode files.
> >>    Loaded: loaded (/home/nikratio/.config/systemd/user/autocommit-org.service; static)
> >>    Active: inactive (dead) since Wed 2015-04-15 22:42:13 PDT; 51s ago
> >>  Main PID: 2820 (code=exited, status=1/FAILURE)
> >> 
> >> Apr 15 22:42:13 vostro systemd[2453]: Starting Auto-commits changes to orgmode fil.....
> >> Apr 15 22:42:13 vostro hg[2820]: nothing changed
> >> Apr 15 22:42:13 vostro systemd[2453]: Started Auto-commits changes to orgmode files..
> >> Hint: Some lines were ellipsized, use -l to show in full.
> >> 
> >> $ cat /home/nikratio/.config/systemd/user/autocommit-org.service
> >> [Unit]
> >> Description=Auto-commits changes to orgmode files.
> >> 
> >> [Service]
> >> Type = oneshot
> >> WorkingDirectory = %h/lib/Dropbox/org
> >> ExecStart = /usr/bin/hg commit -m "Autocommit."
> >> SuccessExitStatus = 1
> >> 
> >> $ systemctl --version
> >> systemd 215
> >> +PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR
> >> 
> >> Why is the unit reported as failed? Shouldn't status=1 be interpreted as
> >> success?
> >
> > Sounds like a bug, possibly an issue with type=oneshot together with
> > SuccessExitStatus.
> 
> Actually it seems to be related to the user of a timer unit to start the
> service. When I just start it manually, it works fine. But if I define a
> timer:
> 
> $ cat autocommit-org.timer 
> [Unit]
> Description = bla
> 
> [Timer]
> OnBootSec = 10
> OnUnitActiveSec = 30
> Unit = autocommit-org.service
> 
> Then the problem occurs.

Any chance you can reduce this to a minimal example I can reproduce
here locally? i.e. no hg involved, please, but instead /bin/false or
so? and no unnecessary settings?

Thanks!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list