This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Timed full shutdown and restart

General support and discussion of Eggdrop bots.
Post Reply
f
fusionx
Voice
Posts: 30
Joined: Sun Jan 16, 2022 1:35 pm

Timed full shutdown and restart

Post by fusionx »

What's the best way to perform a timed FULL, graceful shutdown, then let the bot restart, either through cron or systemd?

I have a bot that gets really wonky after a couple hours, and I want to implement this while I'm trying to resolve the issue. I think I may have to rebuild my hosting environment, as some packages are out of sync, etc.. it's become messy over time as I try to install 3rd party packages that aren't available for my older OS.

Thanks in advance!
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: Timed full shutdown and restart

Post by CrazyCat »

You can try to automatically restart the eggdrop with the following script:
bind cron - "17 */3 * * *" autorestart
proc autorestart {min ho day mo dow} {
   restart
}
This will perform a .restart every time the hour is a multiple of 3 (0, 3, 6, 9, 12, 15, 18, 21) and the minutes are 17.

If the simple restart is not enough, replace it with a die and add a crontab check (have a look to scripts/botchk) with "* * * * *" planification
f
fusionx
Voice
Posts: 30
Joined: Sun Jan 16, 2022 1:35 pm

Re: Timed full shutdown and restart

Post by fusionx »

Thank you for responding! Unfortunately, it needs to be a full shutdown, not a restart. Restarting though the bot doesn't resolve the issues.

"Die" works, with a manual start or waiting for cron to catch it, and kill -SIGTERM pid works.

I wonder if timer works with DIE.
Post Reply