Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2006  / 2 Years ago, mon, march 21, 2022, 5:51:28

I wrote a simple upstart script that kicks off a python program, I have it saved as vgpusher.conf.



It doesn't start automatically, but if I run sudo start vgpusher it starts and runs just fine.



The code is simple:



description "vgpush"

start on runlevel [2345]
stop on runlevel [!2345]

script
cd /home/computer/
python pusher.py
end script


I placed the script in /etc/init. Other than that, I have done no configuration.



The machine is running Ubuntu 10.04 Server.



Do I need to take an extra step for the service to start on startup?


More From » upstart

 Answers
0

First, you don't need script:



description "vgpush"

start on runlevel [2345]
stop on runlevel [!2345]

chdir /home/computer
exec python pusher.py


Second, it may help to log the output. If you upgrade to 12.04 (Highly recommended!) you will have a log in /var/log/upstart/$jobname.log. For 10.04, you have to do it manually:



description "vgpush"

start on runlevel [2345]
stop on runlevel [!2345]

chdir /home/computer
exec python pusher.py 2>&1 >> /var/log/vgpush.log


That may give some clue. If I had to guess, it is because vgpush needs a network interface to be up that is not, and 10.04 starts runlevel 2 before all network interfaces are ready.


[#30399] Monday, March 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hical

Total Points: 498
Total Questions: 106
Total Answers: 117

Location: Comoros
Member since Tue, Mar 14, 2023
1 Year ago
hical questions
Sun, May 9, 21, 00:59, 3 Years ago
Fri, Jun 25, 21, 03:06, 3 Years ago
Thu, May 19, 22, 15:32, 2 Years ago
;