-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cleanup script not running on exit when running the script as a systemd service #67
Comments
While playing around with XivMitmLatencyMitigator/mitigate.py Lines 1617 to 1635 in a32f362
|
Why not just add the cleanup script to the |
That's what I did for now as a workaround but the problem yet remains [Unit]
Description=XivAlexander script
[Service]
Type=simple
User=root
WorkingDirectory=/root/xivalexander
#ExecStart=/bin/bash run.sh
ExecStart=/usr/bin/python3 mitigate.py
ExecStop=-/bin/bash .cleanup.sh
ExecStop=-/bin/rm .cleanup.sh
[Install]
WantedBy=multi-user.target |
Ah I follow now, should maybe just make cleanup callable as a param, or write the iptables rules to some file that can be consumed by cleanup independent of the in-memory ports and crap. I keep the cleanup script around for manual use, so it works just fine in systemd (except I don't use systemd), mostly since using fixed ports. Could be worth it for you, just add a flag and set |
Try this: [Unit]
Description=XivAlexander script
[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/bin/bash run.sh
Restart=on-failure
RestartSec=5
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target (Added #!/bin/bash
curl https://raw.githubusercontent.com/Soreepeong/XivMitmLatencyMitigator/main/mitigate.py | exec python3 (Added It makes it so that sigint (ctrl+c) is passed to the mitigate.py script |
try:
at line 1588 breaks early because of #67 (comment) and not evenfinally:
will run for some reasonMaybe systemd is killing the process early so the script can't find it and it won't execute the rest of the code?
XivMitmLatencyMitigator/mitigate.py
Lines 1588 to 1663 in a32f362
The text was updated successfully, but these errors were encountered: