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

2015-05-19 Thread Lennart Poettering
On Thu, 16.04.15 14:21, Nikolaus Rath (nikol...@rath.org) wrote:

> On Apr 16 2015, Lennart Poettering  wrote:
> > On Wed, 15.04.15 22:45, Nikolaus Rath (nikol...@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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2015-04-16 Thread Nikolaus Rath
On Apr 16 2015, Lennart Poettering  wrote:
> On Wed, 15.04.15 22:45, Nikolaus Rath (nikol...@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.

> Can you paste "systemctl show -a" for that service please?

Sure:

$ systemctl --user show -a autocommit-org.service
Type=oneshot
Restart=no
PIDFile=
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=0
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestamp=
WatchdogTimestampMonotonic=0
StartLimitInterval=1000
StartLimitBurst=5
StartLimitAction=none
RebootArgument=
FailureAction=none
PermissionsStartOnly=no
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
MainPID=0
ControlPID=0
BusName=
StatusText=
Result=success
ExecMainStartTimestamp=Thu 2015-04-16 14:18:32 PDT
ExecMainStartTimestampMonotonic=15216756964
ExecMainExitTimestamp=Thu 2015-04-16 14:18:32 PDT
ExecMainExitTimestampMonotonic=15216834525
ExecMainPID=6794
ExecMainCode=1
ExecMainStatus=1
ExecStart={ path=/usr/bin/hg ; argv[]=/usr/bin/hg commit -m Autocommit. ; 
ignore_errors=no ; start_time=[Thu 2015-04-16 14:18:32 PDT] ; stop_time=[Thu 
2015-04-16 14:18:32 PDT] ; pid=6794 ; code=exited ; status=1 }
Slice=-.slice
ControlGroup=
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=(null)
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
Environment=
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=30556
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=30556
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
WorkingDirectory=/home/nikratio/lib/Dropbox/org
RootDirectory=
OOMScoreAdjust=0
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
CPUAffinity=
TimerSlackNSec=5
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYPath=
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogIdentifier=
SyslogLevelPrefix=yes
Capabilities=
SecureBits=0
CapabilityBoundingSet=18446744073709551615
User=
Group=
SupplementaryGroups=
PAMName=
ReadWriteDirectories=
ReadOnlyDirectories=
InaccessibleDirectories=
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=no
UtmpIdentifier=
SELinuxContext=[unprintable]
AppArmorProfile=[unprintable]
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallFilter=~
SystemCallArchitectures=
SystemCallErrorNumber=0
Personality=
RestrictAddressFamilies=[unprintable]
RuntimeDirectoryMode=0755
RuntimeDirectory=
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=autocommit-org.service
Names=autocommit-org.service
Following=
Requires=basic.target
RequiresOverridable=
Requisite=
RequisiteOverridable=
Wants=-.slice
BindsTo=
PartOf=
RequiredBy=
RequiredByOverridable=
WantedBy=
BoundBy=
ConsistsOf=
Conflicts=shutdown.target
ConflictedBy=
Before=shutdown.target
After=autocommit-org.timer basic.target -.slice home.mount -.mount
OnFailure=
Triggers=
TriggeredBy=autocommit-org.timer
PropagatesReloadTo=
ReloadPropagatedFrom=
JoinsNamespaceOf=
RequiresMountsFor=/home/nikrat

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

2015-04-16 Thread Lennart Poettering
On Wed, 15.04.15 22:45, Nikolaus Rath (nikol...@rath.org) wrote:

> Hello,
> 
> 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.

Can you paste "systemctl show -a" for that service please?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2015-04-15 Thread Nikolaus Rath
Hello,

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?

Thanks,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

 »Time flies like an arrow, fruit flies like a Banana.«
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel