Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd integration limited: systemctl status does not work. #1318

Open
petersilva opened this issue Dec 3, 2024 · 4 comments
Open

systemd integration limited: systemctl status does not work. #1318

petersilva opened this issue Dec 3, 2024 · 4 comments
Labels
bug Something isn't working Sugar nice to have features... not super important. wishlist would be nice, not pressing for any particular client. work-around a work-around is provided, mitigating the issue.

Comments

@petersilva
Copy link
Contributor

petersilva commented Dec 3, 2024

on older operating systemd (redhat8, ubuntu 18.04) at least... the systemd versions do not check for status correctly for sr3. There is some incompatibility. e.g.:

sarra@host:~$ systemctl status metpx-sr3
● metpx-sr3.service - Sarracenia File Copy Service
   Loaded: loaded (/lib/systemd/system/metpx-sr3.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2024-12-03 19:03:55 UTC; 21min ago
  Process: 36353 ExecStop=/usr/bin/sr3 stop (code=exited, status=0/SUCCESS)
  Process: 2889 ExecStart=/usr/bin/sr3 start (code=exited, status=0/SUCCESS)

Dec 03 12:24:43 host systemd[1]: Starting Sarracenia File Copy Service...
Dec 03 12:24:58 host sr3[2889]: starting:.........................( 248 ) Done
Dec 03 12:24:58 host systemd[1]: Started Sarracenia File Copy Service.
Dec 03 19:03:55 host sr3[36353]: Stopping: no procs running...already stopped
sarra@host:~$

So one must use sr3 status to check properly.

Also monitoring is done by having sr3 sanity run periodically using cron (e.g. every 5 minutes.) which will restart crashed processes, and kill strays should any be present.

There is no known approach to fix this at the moment... but newer OS versions seem to understand sr3 better (e.g. ubuntu 24.04.) this problem may go away with time.

@petersilva petersilva added bug Something isn't working work-around a work-around is provided, mitigating the issue. Sugar nice to have features... not super important. labels Dec 3, 2024
@petersilva
Copy link
Contributor Author

fundamental issue is that while we can use sr3 start and sr3 stop by just plugging them into systemd unit files... there is no equivalent place to put sr3 status, and sr3 being a thing that starts up many, many child processes, is not a "normal" service. Judging by google searches, this is a known problem with earlier versions of systemd.

@petersilva petersilva added the wishlist would be nice, not pressing for any particular client. label Dec 3, 2024
petersilva added a commit that referenced this issue Dec 5, 2024
fixes #1318 systemd recommends against Type=forking, preferring
TYPE=notify. To do that, we need to make little api calls
during startup and shutdown. Added those.

This makes systemd happier on startup and seems to show status
messages correctly.
@petersilva
Copy link
Contributor Author

petersilva commented Dec 5, 2024

So that branch... (commits: 56f3db0 7c3ca6e )

it turns out... made everything worse. While I implemented what the documentation seemed to be asking for... in modern versions of systemd... type=forking works much better. Dropped for now.

@petersilva
Copy link
Contributor Author

on newer operating system... the existing config files seem to work fine... sometimes? unclear.

@petersilva
Copy link
Contributor Author

We probably need to look at rules for daemonizing, and review what we aren't doing right... I think 1 problem is that we don't use fork-exec, but we can't use that because it won't work on windows.... so this might be insoluble... or it might require us a lot more platform checks and conditional code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Sugar nice to have features... not super important. wishlist would be nice, not pressing for any particular client. work-around a work-around is provided, mitigating the issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant