Auto restart zenno

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Implement autorestart feature in zennoposter, as there is still problems with Zenno freezing after some days running and sometimes it is even closed down itself. This way some auto restart feature would be good.

I know that I can do auto restart with taskmanager, but this is not what I'm talking there.

Or maybe some additional small program what close all threads first and then just restart Zenno would be good.

Thanks
 

Yann

Client
Регистрация
22.04.2017
Сообщения
207
Благодарностей
31
Баллы
28
Yes, that would be interesting, we need to add extra checks to make sure zenno is always running
 

Andreas

Новичок
Регистрация
28.07.2014
Сообщения
12
Благодарностей
0
Баллы
1
I agree, I have the same problem. Some jobs are simply dead after some time. Or must I buy Winautomation to restart zenno?
 

sMax

Client
Регистрация
04.05.2011
Сообщения
132
Благодарностей
49
Баллы
28
@lokiys , @Yann , @Andreas

Yes, this has been happening a lot on my 5.10.6 and 5.11.5 so I made a little program for it.
It simply starts an endless loop that checks is ZP is active.
If not it starts it up.
then it goes to sleep for the duration of the first parameter.
the second parameter is the location of your ZP exe file.

I just placed it in the program files folder and use a shortcut to start it
ZPRestart01.JPG


and I also put it in the startup folder so it will start up when the machine starts
ZPRestart02.JPG


to start it
"C:\Program Files\ZPProReStartv1.exe" 300000 "C:\Program Files\ZennoLab\EN\ZennoPoster Pro\5.11.5.0\Progs\"
You might need to use the alternative folder name to create the shortcut (PROGRA~1) to avoid the double quotation.

-300000 is the pause time in milliseconds (5 min) (make sure the time is more than your ZP takes to load)
-the location of ZP may change depending on how you update, so if the version is in the path , you will have to update the shortcut

after it starts it just sits in the task bar.

Hope that helps
 

Вложения

  • Спасибо
Реакции: aidenhera

Yann

Client
Регистрация
22.04.2017
Сообщения
207
Благодарностей
31
Баллы
28
this is interesting but it might not be enough. For instance yesterday, for some reasons, all my scripts are stopped but zennoposter is running. So unfortunately that would not help in this case :(
It would be great to add an optional extra check to your program, which is "if zenno is running but all scripts are stopped, start them"
Something like that, but it is tricky because I have some scripts that are stopped for a reason and that I would not want to start...

Maybe a solution would be to create a label "active" for the scripts that should never be stopped and check those ?

What do you think ?
 

sMax

Client
Регистрация
04.05.2011
Сообщения
132
Благодарностей
49
Баллы
28
@Yann
At this point I don't think its feasible for me to make a check on stalled scripts within zp as I do not have those issues and I think those are driver issues (how you make your templates). Maybe it is because I use short templates that are connected by data apis or call sub processes that don't overwhelm my server resources, also when I see a zenno function as being unstable I replace it with a call to a stable program.
(and finding out which thread is waiting/hung for what reason, coupled with when to restart or not seems ....the logic is .. ie when is stopped a crash and when is it ok? ..... to me it seems better , more efficient and less error prone to just make short processes that run and end and the follow up that picks up on the end of those processes.)

Monitoring for a zp hang and closing it when ZP has a windows "hang" code is interesting to me, but I have not seen this happen in quite a while, and so I can not test it. Adding a restart after a certain amount of time is also interesting to me.

TL;DR
If I have some time over this week , I'll make one that closes a hung ZP, and also closes it after an amount of time. That should not take too much time (and is something I can see myself using).
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
Auto restart is not possible in Zenno. because of special way of running templates and tasks.
When you get ZP freeze, please make diagnostic and send us report. We should treat causes, not symptoms.
 

sonatine

Client
Регистрация
20.08.2014
Сообщения
206
Благодарностей
2
Баллы
18
@lokiys , @Yann , @Andreas

Yes, this has been happening a lot on my 5.10.6 and 5.11.5 so I made a little program for it.
It simply starts an endless loop that checks is ZP is active.
If not it starts it up.
then it goes to sleep for the duration of the first parameter.
the second parameter is the location of your ZP exe file.

I just placed it in the program files folder and use a shortcut to start it
Посмотреть вложение 22964

and I also put it in the startup folder so it will start up when the machine starts
Посмотреть вложение 22965

to start it
"C:\Program Files\ZPProReStartv1.exe" 300000 "C:\Program Files\ZennoLab\EN\ZennoPoster Pro\5.11.5.0\Progs\"
You might need to use the alternative folder name to create the shortcut (PROGRA~1) to avoid the double quotation.

-300000 is the pause time in milliseconds (5 min) (make sure the time is more than your ZP takes to load)
-the location of ZP may change depending on how you update, so if the version is in the path , you will have to update the shortcut

after it starts it just sits in the task bar.

Hope that helps
this is really interesting but i want to do this:
close ZP after two or three hours and restart that.
can your program do that?
 

sMax

Client
Регистрация
04.05.2011
Сообщения
132
Благодарностей
49
Баллы
28
@VladZen is right, the reason why it is crashing should be solved, and he is also right that you can not do this by process and say wich process is to be shut down, because depending on how you set it up, you don't know which thread is running in witch base, not from the outside of ZP anyway.

But in the meantime, I noticed that my throughput of jobs went up 50%, so my ZP's where down more than I thought or longer than I thought and now they get restarted automatically.

So I saw I had made it to work only with "Zennoposter Pro" and that it seems that if the screen locks, the start program can't see if zennoposter is running or not (because of the "easy" way it is doing this), I just disabled the sleep and lock on that virtualbox, works for me.

The check for "Zennoposter Pro" has been changed to "Zennoposter" so it should work in all versions now.

Now there are 3 progs (in the attached zip)

1) ZPTimedEnd. "C:\Program Files\ZPTimedEnd.exe" 300000 . The parm is the time between ending Zennoposter in milliseconds. 3 hours would be 3 x 60 x 60 x 1000 = 10800000. I won't do conversions in there , I want these small and simple. Tested this with a 5 min delay and it works.

2) ZPHangEnd. "C:\Program Files\ZPHangEnd.exe" 300000 . The param is check delay. Checks to see if the zennoposter process is hung, if so it stops it.
This is untested, it's running, but I have not seen ZP hang in a while with the versions I have (5.11 in win7 virtualboxes)
If you have a template that continuously hangs ZP (not a thread), test and see if it works, if you can send the template for me to test with, or describe a "way" to hang zennoposter, and this doesn't work as is, it could possibly be solved.

3) ZPReStart. "C:\Program Files\ZPReStart.exe" 300000 "C:\Program Files\ZennoLab\EN\ZennoPoster Pro\5.11.6.0\Progs\" See http://zennolab.com/discussion/threads/auto-restart-zenno.28160/#post-301960 above.

You can run any combo you like.

Make sure you have backups of your template settings. The newer versions of ZP do this automatically. I have been using my own template for this since http://zennolab.com/discussion/threads/this-is-urgent-a-way-to-back-up-the-templates-in-the-scheduler.7130/#post-42647

@sonatine Yes, ZPTimedEnd.

*only works on the english version at this moment.
 

Вложения

Последнее редактирование:

Yann

Client
Регистрация
22.04.2017
Сообщения
207
Благодарностей
31
Баллы
28
I agree, @VladZen is right, what we really need is that zenno does not crash in the first place.

I could almost use your programs but I would need to be able to choose when exactly to restart Zennoposter, and not let's say every 3 hours.

However, regarding my need to activate stopped templates after crash, there is a simple solution: create a .bat file with "run" action for the templates that always need to be active and launch it after zenno has restarted.

bat.jpg bat2.jpg
 

sMax

Client
Регистрация
04.05.2011
Сообщения
132
Благодарностей
49
Баллы
28
@Yann In my zp all threads that were active at the time of the crash are relaunched automatically, but I set things up in the scheduler or in the task manager and not as loops. I only start one time /manual templates without a scheduler or task manager.
Doing it in the batch file is also good if it works for you.

**And I have to correct myself here, It is possible to close a running zennoposter from within a stalled/non-active thread with no weird side effects.
If I have some time tonight or tomorrow i will clean up the code and post a new zip.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)