Upstart running python script
up vote
0
down vote
favorite
Ubuntu 14.04
I have simple upstart job test.conf
:
root@ubuntutest:~# cat /etc/init/test.conf
expect fork
script
/root/test.py
end script
and simple python script /root/test.py
:
root@ubuntutest:~# cat /root/test.py
#!/usr/bin/python
import time
print("Hello, World")
time.sleep(30)
print("Goodbye")
I start test job, ensure that upstart tracks proper PID, wait script's termination, but than upstart doesn't stop tracking non-existing PID. So i'm not able top stop this job:
root@ubuntutest:~# initctl status test
test stop/waiting
root@ubuntutest:~# initctl start test
test start/running, process 1859
root@ubuntutest:~# ps aux | grep 1859
root 1859 0.2 0.7 29832 7188 ? S 14:43 0:00 /usr/bin/python /root/test.py
root 1862 0.0 0.2 11760 2156 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# ps aux | grep 1859
root 1864 0.0 0.2 11760 2224 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# initctl status test
test start/running, process 1859
If i delete expect fork
from test job then everything works good (except upstart tracks sh
instead of python
) - i want to understand what's wrong with my code?
The same happens if i use bash script instead of python:
#!/bin/bash
sleep 30
Upstart shows that test
job is always running (even when the script ends)
scripts python upstart
add a comment |
up vote
0
down vote
favorite
Ubuntu 14.04
I have simple upstart job test.conf
:
root@ubuntutest:~# cat /etc/init/test.conf
expect fork
script
/root/test.py
end script
and simple python script /root/test.py
:
root@ubuntutest:~# cat /root/test.py
#!/usr/bin/python
import time
print("Hello, World")
time.sleep(30)
print("Goodbye")
I start test job, ensure that upstart tracks proper PID, wait script's termination, but than upstart doesn't stop tracking non-existing PID. So i'm not able top stop this job:
root@ubuntutest:~# initctl status test
test stop/waiting
root@ubuntutest:~# initctl start test
test start/running, process 1859
root@ubuntutest:~# ps aux | grep 1859
root 1859 0.2 0.7 29832 7188 ? S 14:43 0:00 /usr/bin/python /root/test.py
root 1862 0.0 0.2 11760 2156 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# ps aux | grep 1859
root 1864 0.0 0.2 11760 2224 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# initctl status test
test start/running, process 1859
If i delete expect fork
from test job then everything works good (except upstart tracks sh
instead of python
) - i want to understand what's wrong with my code?
The same happens if i use bash script instead of python:
#!/bin/bash
sleep 30
Upstart shows that test
job is always running (even when the script ends)
scripts python upstart
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Ubuntu 14.04
I have simple upstart job test.conf
:
root@ubuntutest:~# cat /etc/init/test.conf
expect fork
script
/root/test.py
end script
and simple python script /root/test.py
:
root@ubuntutest:~# cat /root/test.py
#!/usr/bin/python
import time
print("Hello, World")
time.sleep(30)
print("Goodbye")
I start test job, ensure that upstart tracks proper PID, wait script's termination, but than upstart doesn't stop tracking non-existing PID. So i'm not able top stop this job:
root@ubuntutest:~# initctl status test
test stop/waiting
root@ubuntutest:~# initctl start test
test start/running, process 1859
root@ubuntutest:~# ps aux | grep 1859
root 1859 0.2 0.7 29832 7188 ? S 14:43 0:00 /usr/bin/python /root/test.py
root 1862 0.0 0.2 11760 2156 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# ps aux | grep 1859
root 1864 0.0 0.2 11760 2224 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# initctl status test
test start/running, process 1859
If i delete expect fork
from test job then everything works good (except upstart tracks sh
instead of python
) - i want to understand what's wrong with my code?
The same happens if i use bash script instead of python:
#!/bin/bash
sleep 30
Upstart shows that test
job is always running (even when the script ends)
scripts python upstart
Ubuntu 14.04
I have simple upstart job test.conf
:
root@ubuntutest:~# cat /etc/init/test.conf
expect fork
script
/root/test.py
end script
and simple python script /root/test.py
:
root@ubuntutest:~# cat /root/test.py
#!/usr/bin/python
import time
print("Hello, World")
time.sleep(30)
print("Goodbye")
I start test job, ensure that upstart tracks proper PID, wait script's termination, but than upstart doesn't stop tracking non-existing PID. So i'm not able top stop this job:
root@ubuntutest:~# initctl status test
test stop/waiting
root@ubuntutest:~# initctl start test
test start/running, process 1859
root@ubuntutest:~# ps aux | grep 1859
root 1859 0.2 0.7 29832 7188 ? S 14:43 0:00 /usr/bin/python /root/test.py
root 1862 0.0 0.2 11760 2156 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# ps aux | grep 1859
root 1864 0.0 0.2 11760 2224 pts/0 S+ 14:43 0:00 grep --color=auto 1859
root@ubuntutest:~# initctl status test
test start/running, process 1859
If i delete expect fork
from test job then everything works good (except upstart tracks sh
instead of python
) - i want to understand what's wrong with my code?
The same happens if i use bash script instead of python:
#!/bin/bash
sleep 30
Upstart shows that test
job is always running (even when the script ends)
scripts python upstart
scripts python upstart
edited Nov 15 at 12:44
asked Nov 15 at 11:51
stepanov.dmit
12
12
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1093155%2fupstart-running-python-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown