-
Notifications
You must be signed in to change notification settings - Fork 7
systemd: add persistent state and report with different intervals #35
Conversation
Tested by overwriting the systemd file with Got denied permission error on startup:
EDIT: Investigating ... SOLVED: |
b006e35
to
b503ecb
Compare
Currently the program runs without producing any error, however the
This might because the parent process in the main function spawn a child process and exit immediately in order to make pinger a Daemon process. And accessing the account after the parent process exits might cause the |
There's no need to fork here; we're not starting the pinger from a terminal, but via systemd. The |
This has some good information: http://0pointer.de./public/systemd-man/daemon.html |
@jlebon Thanks for the link! |
Investigating.. EDIT: EDIT2: |
Signed-off-by: Allen Bai <abai@redhat.com>
b503ecb
to
8d8ed86
Compare
Container runtime issue resolved by calling |
Tested in a local FCOS machine, ready for reviews. EDIT:
Looks like the service failed to set up the state directory which belongs to the dynamic user. Found this issue when running tests with EDIT2: |
It turns out that systemd does not allow sharing persistent directories across different dynamic users, which is odd and might be a bug. However, using Since the data collections PR will dependent on this PR, changes are committed there (link:ecf60b2) |
This PR should not be merged and only stays as a reference, since works are merged with the data collection PR. |
Closing |
Add
StateDirecory=fedora-coreos-pinger
to the systemd file and store different timestamps in the persistent files under/var/lib/fedora-coreos-pinger
, for example (timestamp_daily
andtimestamp_monthly
). Report when intervals between timestamps are more than one day or one month.Signed-off-by: Allen Bai abai@redhat.com