On Fri, Sep 29, 2017 at 01:27:26PM +0100, Matthew Vernon wrote:
timeout should (optionally) emit an error message when the timeout is
reached. This would make debugging a range of issues easier, but my
case in point is ceph, which has, in a service file:
ExecStart=/bin/sh -c 'timeout 120 flock /var/lock/ceph-disk-$(basename
%f) /usr/sbin/ceph-disk --verbose --log-stdout trigger --sync %f'
Currently nothing is logged when this timeout is reached, which made
debugging a startup issue needlessly fiddly. It would be good to have
an option (e.g. --log-on-exit or --verbose or somesuch) which would
make timeout say something like "timeout elapsed, killing ...".
Try
ExecStart=/bin/sh -c 'timeout 120 flock /var/lock/ceph-disk-$(basename %f) /usr/sbin/ceph-disk --verbose --log-stdout trigger --sync %f ; RET=$? ; if [ $RET -eq 124 ] ; then echo "Timed out!" ; fi ; return $RET'
Mike Stone