Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conductor start/stop init-style shell script. #48

Merged

Conversation

cwolferh
Copy link
Contributor

@cwolferh cwolferh commented Feb 6, 2013

Use foreman to start the 3 conductor services. Addresses the
conductor side of
#20
but deltacloud is still a TODO.

@martinpovolny
Copy link

checkpid `cat $FOREMAN_PID`

vs.

checkpid `<$FOREMAN_PID`

wins the "useless cat of the day" price although I have heard today that "a command w/o a pipe is not worth running" :-D

or the more readable bracket-%-vim-jumpable, nested-usable variant:

checkpid $(<$FOREMAN_PID)

then the [ -z $variable ] is yet another way to test emptiness introduced into the script, but that has to be unified in some refactoring patch

will put it to a test on some machine next

@ghost ghost assigned martinpovolny Feb 6, 2013
@martinpovolny
Copy link

Fedora 18

  • it installs
  • it works at the start, but then it stops working
[test@intel-chiefriver-02 pull-request-48]$ bin/conductor stop
Shutting down foreman: OK
[test@intel-chiefriver-02 pull-request-48]$ lsof -i :3033
[test@intel-chiefriver-02 pull-request-48]$ bin/conductor start
Starting foreman: OK
[test@intel-chiefriver-02 pull-request-48]$ lsof -i :3033
[test@intel-chiefriver-02 pull-request-48]$ lsof -i
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ruby    1311 test    8u  IPv6 145691      0t0  TCP localhost:43162->localhost:postgres (ESTABLISHED)
ruby    1311 test   12u  IPv4 147493      0t0  TCP *:pdb (LISTEN)
ruby    1315 test    8u  IPv6 144916      0t0  TCP localhost:43163->localhost:postgres (ESTABLISHED)
[test@intel-chiefriver-02 pull-request-48]$ bin/conductor stop
Shutting down foreman: FAILED TO SHUTDOWN FOREMAN_PROG
[test@intel-chiefriver-02 pull-request-48]$ bin/conductor start
Starting foreman: OK
[test@intel-chiefriver-02 pull-request-48]$ bin/conductor start
Starting foreman: 
foreman is already running
[test@intel-chiefriver-02 pull-request-48]$ bin/conductor stop
Shutting down foreman: FAILED TO SHUTDOWN FOREMAN_PROG

then it works again and the it stops working again

seems there's some issue when stopping

Use foreman to start the 3 conductor services.  Addresses the
conductor side of
aeolus-incubator#20
but deltacloud is still a TODO.
@cwolferh
Copy link
Contributor Author

cwolferh commented Feb 6, 2013

I've modified the stop function in the startup script-- seems to be working better now. Also, I added a restart "shortcut."

[test@localhost ~]$ /home/test/pull-request-48/bin/conductor stop
Shutting down foreman: OK
[test@localhost ~]$ /home/test/pull-request-48/bin/conductor start
Starting foreman: OK
[test@localhost ~]$ /home/test/pull-request-48/bin/conductor start
Starting foreman:
foreman is already running
[test@localhost ~]$ /home/test/pull-request-48/bin/conductor stop
Shutting down foreman: OK
[test@localhost ~]$ /home/test/pull-request-48/bin/conductor stop
Shutting down foreman: /home/test/pull-request-48/conductor/src/tmp/foreman.pid non-existant or process not running
[test@localhost ~]$ /home/test/pull-request-48/bin/conductor restart
Shutting down foreman: /home/test/pull-request-48/conductor/src/tmp/foreman.pid non-existant or process not running
Starting foreman: OK
[test@localhost ~]$ /home/test/pull-request-48/bin/conductor restart
Shutting down foreman: OK
Starting foreman: OK
[test@localhost ~]$ /home/test/pull-request-48/bin/conductor restart
Shutting down foreman: OK
Starting foreman: OK
[test@localhost ~]$ ps -ef | grep -P '(ruby|foreman)'
test     21725     1  0 16:38 pts/2    00:00:00 foreman: master                                                                               \
test     21727 21725 50 16:38 pts/2    00:00:08 /home/test/.rbenv/versions/1.9.3-p374/bin/ruby script/rails s -p 3033
test     21729 21725 46 16:38 pts/2    00:00:07 ruby dbomatic/dbomatic --log log --pid-file tmp -n
test     21731 21725 48 16:38 pts/2    00:00:08 ruby /home/test/pull-request-48/conductor/src/bundle/ruby/1.9.1/bin/rake jobs:work

@martinpovolny
Copy link

works as expected

martinpovolny added a commit that referenced this pull request Feb 7, 2013
Conductor start/stop init-style shell script.
@martinpovolny martinpovolny merged commit 5e7d361 into aeolus-incubator:master Feb 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants