1

When I see status of sysstat is see the following,

● sysstat.service - Resets System Activity Logs
Loaded: loaded (/usr/lib/systemd/system/sysstat.service; enabled; 
vendor preset: enabled)
Active: active (exited) since Wed 2018-11-28 11:46:45 EST; 4s ago
Process: 4159 ExecStart=/usr/lib64/sa/sa1 --boot (code=exited, 
status=0/SUCCESS)
Main PID: 4159 (code=exited, status=0/SUCCESS)

Nov 28 11:46:45 localhost systemd[1]: Starting Resets System 
Activity Logs...
Nov 28 11:46:45 localhost systemd[1]: Started Resets System 
Activity Logs.

Also couldn’t find any pid specified above.

Question is, why this happens?

  • Deleted assumption as wrong assumption is pointless. – muhammad Nov 28 '18 at 20:32
  • Oneshot run, after which the regular performance capture is via cron, e.g. /etc/cron.d/sysstat – steve Nov 28 '18 at 22:32
3

Your assumption is wrong. sysstat is a "oneshot" type service, meaning it executes once and then it exits:

$ cat /usr/lib/systemd/system/sysstat.service

#... elided ...

[Service]
Type=oneshot
RemainAfterExit=yes
User=root
ExecStart=/usr/lib64/sa/sa1 --boot

#... elided ...

... which explains why there is no PID -- because there is no process any more.

The documentation for systemd services says, in part:

Behavior of oneshot is similar to simple; however, it is expected that the process has to exit before systemd starts follow-up units.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.