[Supervisor-users] Run script once

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Supervisor-users] Run script once

smainklh
Hello,

I can imagine it's not the first time the you see this question :
I would like to run a script at supervisord startup which exits immediately and perform a task.
Could you please help me to find how could i do this kind of operation ?

Thank you,
Smana
_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
rod
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Run script once

rod
I think this was asked recently, and the suggestion was to set autorestart to false.  So your script will start with supervisord, can then exit, and will not be restarted.


On 2 April 2014 13:53, <[hidden email]> wrote:
Hello,

I can imagine it's not the first time the you see this question :
I would like to run a script at supervisord startup which exits immediately and perform a task.
Could you please help me to find how could i do this kind of operation ?

Thank you,
Smana
_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users


_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Run script once

smainklh
Hello rod,

Thanks for your quick answer.
Actually i already tested what you suggested.
Here is my configuration :

[program:myscript]
command=/root/toto.sh
autostart=false
autorestart=false
startretries=0
redirect_stderr=false
redirect_stderr=false

It works but when it is started, supervisord sees the execution as an error:

supervisorctl
myscript                STOPPED    Not started
sshd                             RUNNING    pid 9, uptime 0:00:56
supervisor> start myscript
runcommonservices: ERROR (abnormal termination)
supervisor> status
runcommonservices                FATAL      Exited too quickly (process log may have details)

Is it normal ? Maybe it expects only forgeground processes ?

Regards,
Smana


----- Mail original -----
De: "rod" <[hidden email]>
À: [hidden email]
Cc: [hidden email]
Envoyé: Mercredi 2 Avril 2014 14:56:11
Objet: Re: [Supervisor-users] Run script once


I think this was asked recently, and the suggestion was to set autorestart to false. So your script will start with supervisord, can then exit, and will not be restarted.



On 2 April 2014 13:53, < [hidden email] > wrote:


Hello,

I can imagine it's not the first time the you see this question :
I would like to run a script at supervisord startup which exits immediately and perform a task.
Could you please help me to find how could i do this kind of operation ?

Thank you,
Smana
_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users 
_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
rod
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Run script once

rod
The error suggests it exited too quickly, Perhaps setting startsecs to 0 or 1 would help (if your script exits very quickly).  Also make sure your process is exiting with a 0 code of course.


On 2 April 2014 14:14, <[hidden email]> wrote:
Hello rod,

Thanks for your quick answer.
Actually i already tested what you suggested.
Here is my configuration :

[program:myscript]
command=/root/toto.sh
autostart=false
autorestart=false
startretries=0
redirect_stderr=false
redirect_stderr=false

It works but when it is started, supervisord sees the execution as an error:

supervisorctl
myscript                STOPPED    Not started
sshd                             RUNNING    pid 9, uptime 0:00:56
supervisor> start myscript
runcommonservices: ERROR (abnormal termination)
supervisor> status
runcommonservices                FATAL      Exited too quickly (process log may have details)

Is it normal ? Maybe it expects only forgeground processes ?

Regards,
Smana


----- Mail original -----
De: "rod" <[hidden email]>
À: [hidden email]
Cc: [hidden email]
Envoyé: Mercredi 2 Avril 2014 14:56:11
Objet: Re: [Supervisor-users] Run script once


I think this was asked recently, and the suggestion was to set autorestart to false. So your script will start with supervisord, can then exit, and will not be restarted.



On 2 April 2014 13:53, < [hidden email] > wrote:


Hello,

I can imagine it's not the first time the you see this question :
I would like to run a script at supervisord startup which exits immediately and perform a task.
Could you please help me to find how could i do this kind of operation ?

Thank you,
Smana
_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users


_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Run script once

Marcos Cano
Are you sure your command is not daemonizing itself? 

On Wednesday, April 2, 2014, rod <[hidden email]> wrote:
The error suggests it exited too quickly, Perhaps setting startsecs to 0 or 1 would help (if your script exits very quickly).  Also make sure your process is exiting with a 0 code of course.


On 2 April 2014 14:14, <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;smainklh@free.fr&#39;);" target="_blank">smainklh@...> wrote:
Hello rod,

Thanks for your quick answer.
Actually i already tested what you suggested.
Here is my configuration :

[program:myscript]
command=/root/toto.sh
autostart=false
autorestart=false
startretries=0
redirect_stderr=false
redirect_stderr=false

It works but when it is started, supervisord sees the execution as an error:

supervisorctl
myscript                STOPPED    Not started
sshd                             RUNNING    pid 9, uptime 0:00:56
supervisor> start myscript
runcommonservices: ERROR (abnormal termination)
supervisor> status
runcommonservices                FATAL      Exited too quickly (process log may have details)

Is it normal ? Maybe it expects only forgeground processes ?

Regards,
Smana


----- Mail original -----
De: "rod" <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;rod@pu-gh.com&#39;);" target="_blank">rod@...>
À: <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;smainklh@free.fr&#39;);" target="_blank">smainklh@...
Cc: <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;supervisor-users@lists.supervisord.org&#39;);" target="_blank">supervisor-users@...
Envoyé: Mercredi 2 Avril 2014 14:56:11
Objet: Re: [Supervisor-users] Run script once


I think this was asked recently, and the suggestion was to set autorestart to false. So your script will start with supervisord, can then exit, and will not be restarted.



On 2 April 2014 13:53, < <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;smainklh@free.fr&#39;);" target="_blank">smainklh@... > wrote:


Hello,

I can imagine it's not the first time the you see this question :
I would like to run a script at supervisord startup which exits immediately and perform a task.
Could you please help me to find how could i do this kind of operation ?

Thank you,
Smana
_______________________________________________
Supervisor-users mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Supervisor-users@lists.supervisord.org&#39;);" target="_blank">Supervisor-users@...
https://lists.supervisord.org/mailman/listinfo/supervisor-users


_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users
Reply | Threaded
Open this post in threaded view
|

Re: [Supervisor-users] Run script once

smainklh
Hello Marcos,

Yes i'm, it runs a task then exits with a code 0.
Thank you

Smana

----- Mail original -----
De: "Marcos Cano" <[hidden email]>
À: "rod" <[hidden email]>
Cc: [hidden email], [hidden email]
Envoyé: Mercredi 2 Avril 2014 19:35:44
Objet: Re: [Supervisor-users] Run script once

Are you sure your command is not daemonizing itself?

On Wednesday, April 2, 2014, rod < [hidden email] > wrote:



The error suggests it exited too quickly, Perhaps setting startsecs to 0 or 1 would help (if your script exits very quickly). Also make sure your process is exiting with a 0 code of course.



On 2 April 2014 14:14, < [hidden email] > wrote:


Hello rod,

Thanks for your quick answer.
Actually i already tested what you suggested.
Here is my configuration :

[program:myscript]
command=/root/toto.sh
autostart=false
autorestart=false
startretries=0
redirect_stderr=false
redirect_stderr=false

It works but when it is started, supervisord sees the execution as an error:

supervisorctl
myscript STOPPED Not started
sshd RUNNING pid 9, uptime 0:00:56
supervisor> start myscript
runcommonservices: ERROR (abnormal termination)
supervisor> status
runcommonservices FATAL Exited too quickly (process log may have details)

Is it normal ? Maybe it expects only forgeground processes ?

Regards,
Smana


----- Mail original -----
De: "rod" < [hidden email] >
À: [hidden email]
Cc: [hidden email]
Envoyé: Mercredi 2 Avril 2014 14:56:11
Objet: Re: [Supervisor-users] Run script once




I think this was asked recently, and the suggestion was to set autorestart to false. So your script will start with supervisord, can then exit, and will not be restarted.



On 2 April 2014 13:53, < [hidden email] > wrote:


Hello,

I can imagine it's not the first time the you see this question :
I would like to run a script at supervisord startup which exits immediately and perform a task.
Could you please help me to find how could i do this kind of operation ?

Thank you,
Smana
_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users 

_______________________________________________
Supervisor-users mailing list
[hidden email]
https://lists.supervisord.org/mailman/listinfo/supervisor-users