WebFaction
Community site: login faq

Hi,

I have been using Fabric for years to restart my server processes. Here is the code in my fabfile:

def restart():
    print 'Restarting...'
    with cd('/home/my_account/webapps/myapp_wsgi/apache2/bin'):
        run('pwd')
        run('./stop')
        sleep(5)
        run('./start')

The stop function works. But the start function has stopped working. There are no error messages.

When I login to my account with SSH and run the commands manually, everything works.

Anyone have ideas what's going on? Or how to debug this?

Thanks, Chuck

asked 19 Jul '13, 08:22

cwurld2
5137
accept rate: 0%

Can you try specifying the full path to your apache start command to see if that makes any difference?

(19 Jul '13, 15:37) bmeyer71 ♦♦

I just tried that. Did not make a difference.

(19 Jul '13, 16:09) cwurld2

Try redirecting the output to a file to see if there are any errors when executed this way.

(19 Jul '13, 16:38) bmeyer71 ♦♦

The file was created. But it was empty.

(19 Jul '13, 17:19) cwurld2

I can't see any reason the start command wouldn't run if stop works. As a workaround, you could create a shell script on the server with your stop/sleep/start commands. Could at least give that a try to see if it works.

(19 Jul '13, 18:59) bmeyer71 ♦♦

Thanks!

I just found the answer - http://docs.fabfile.org/en/1.4.3/faq.html#init-scripts-don-t-work

(20 Jul '13, 08:47) cwurld2
showing 5 of 6 show 1 more comments

Had the same issue and the answer from @cwurld2 did it for me. Here it is again, since it is hidden somewhat in the comments:

I just found the answer - http://docs.fabfile.org/en/1.4.3/faq.html#init-scripts-don-t-work

permanent link

answered 05 Feb '15, 07:22

Snirp
226
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×56
×7
×5

question asked: 19 Jul '13, 08:22

question was seen: 2,174 times

last updated: 05 Feb '15, 07:22

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM