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

Re: No feedback from systemd / "systemctl stop X"... Nothing on stdout, nothing that `echo $?` can see...



On 2015-03-11, Martinx - ジェームズ <thiagocmartinsc@gmail.com> wrote:
> Hey guys,
>
>  With SysVinit or Upstart, when we stop/start a service, we can see a
> feedback from the command output. Like "service blah stopping..."

You can do 'systemctl status blah.service'. It gives a nice summary
(with colour!) of the status of the service, and a snippet of the
relevant log file in context.

>
>  Also, we can use, for example, `echo $?`, after the command, to see
> if it was executed according, or not, for example:
>
>  cat /etc/passwd
>  echo $?
>  0
>
>  cat /etc/blah
>  echo $?
>  1

The same applies for the command I gave above. However, in both cases
you're getting the exit code of the command, rather than the status of
the service.

>
>  But, I'm not seeing the same behavior when using systemd commands...
> I mean, how can I "track" systemd if it does provides any kind of
> "usual" outputs to stdout?
>
>  What am I missing?
>
> Thanks!
> Thiago
>
>

-- 

Liam



Reply to: