Guys, I recently installed CruiseControl and I love it. So much that I want to run it on its own server to handle all of my building needs. I installed it, added projects, ran it, and everything was groovy. I decided to stick the process in the background via: ./cruise start & And it put it in the background just fine too. Everything was kosher until I tried logging out of my server. CruiseControl seemed to not want to relinquish control of my SSH connection. I thought perhaps it was a fluke on my connection so I just forcefully disconnected and tried triggering CC to build, which failed with the following message: [error] Input/output error [error] ./script/../config/../builder_plugins/installed/ minimal_console_logger.rb:20:in `write'' [error] ./script/../config/../builder_plugins/installed/ minimal_console_logger.rb:20:in `puts'' [error] ./script/../config/../builder_plugins/installed/ minimal_console_logger.rb:20:in `new_revisions_detected'' [error] ./script/../config/../app/models/project.rb:325:in `send'' [error] ./script/../config/../app/models/project.rb:325:in `notify'' [error] ./script/../config/../app/models/project.rb:323:in `collect'' [error] ./script/../config/../app/models/project.rb:323:in `notify'' [error] ./script/../config/../app/models/project.rb:208:in `build_if_necessary'' [error] ./script/../config/../app/models/polling_scheduler.rb:13:in `run'' [error] ./script/builder:79 [error] ./script/builder:78:in `catch'' [error] ./script/builder:78 [error] script/../config/../cruise:14:in `load'' [error] script/../config/../cruise:14:in `builder'' [error] script/../config/../cruise:68:in `send'' [error] script/../config/../cruise:68 [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' [error] script/../config/../cruise:67 [error] Input/output error [error] ./script/../config/../builder_plugins/installed/ minimal_console_logger.rb:24:in `write'' [error] ./script/../config/../builder_plugins/installed/ minimal_console_logger.rb:24:in `puts'' [error] ./script/../config/../builder_plugins/installed/ minimal_console_logger.rb:24:in `build_loop_failed'' [error] ./script/../config/../app/models/project.rb:325:in `send'' [error] ./script/../config/../app/models/project.rb:325:in `notify'' [error] ./script/../config/../app/models/project.rb:323:in `collect'' [error] ./script/../config/../app/models/project.rb:323:in `notify'' [error] ./script/../config/../app/models/project.rb:213:in `build_if_necessary'' [error] ./script/../config/../app/models/polling_scheduler.rb:13:in `run'' [error] ./script/builder:79 [error] ./script/builder:78:in `catch'' [error] ./script/builder:78 [error] script/../config/../cruise:14:in `load'' [error] script/../config/../cruise:14:in `builder'' [error] script/../config/../cruise:68:in `send'' [error] script/../config/../cruise:68 [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' [error] script/../config/../cruise:67 [error] Input/output error [error] ./script/../config/../lib/cruise_control/log.rb:35:in `write'' [error] ./script/../config/../lib/cruise_control/log.rb:35:in `puts'' [error] ./script/../config/../lib/cruise_control/log.rb:35:in `method_missing'' [error] ./script/../config/../app/models/project.rb:327:in `notify'' [error] ./script/../config/../app/models/project.rb:323:in `collect'' [error] ./script/../config/../app/models/project.rb:323:in `notify'' [error] ./script/../config/../app/models/project.rb:208:in `build_if_necessary'' [error] ./script/../config/../app/models/polling_scheduler.rb:13:in `run'' [error] ./script/builder:79 [error] ./script/builder:78:in `catch'' [error] ./script/builder:78 [error] script/../config/../cruise:14:in `load'' [error] script/../config/../cruise:14:in `builder'' [error] script/../config/../cruise:68:in `send'' [error] script/../config/../cruise:68 [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' [error] script/../config/../cruise:67 [fatal] Input/output error [fatal] ./script/../config/../app/models/polling_scheduler.rb:62:in `write'' [fatal] ./script/../config/../app/models/polling_scheduler.rb:62:in `puts'' [fatal] ./script/../config/../app/models/polling_scheduler.rb:62:in `log_error'' [fatal] ./script/../config/../app/models/polling_scheduler.rb:17:in `run'' [fatal] ./script/builder:79 [fatal] ./script/builder:78:in `catch'' [fatal] ./script/builder:78 [fatal] script/../config/../cruise:14:in `load'' [fatal] script/../config/../cruise:14:in `builder'' [fatal] script/../config/../cruise:68:in `send'' [fatal] script/../config/../cruise:68 [fatal] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' [fatal] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' [fatal] script/../config/../cruise:67 [info] [2008-03-31 10:59:48] Builder for project ''noaama_trunk'' exited It appears that CruiseControl always wants a console to write to. I thought this was because of WEBRICK so I forced it to start in Daemon mode. Unfortunately that did not work and I am now at a loss. Is there something special I need to do to get CruiseControl to build projects in the background, so I can start it up as a service and let it do its work? I am running CentOS 5 and Ruby 1.8.6. Any insight would be greatly appreciated. Billy -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Try this: ./cruise start --daemon For more info: ./cruise help start -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cruisecontrolrb-users/attachments/20080331/937b8875/attachment.html
I think there is an example init script in the source somewhere. Also, I think I posted some improvements on it to the mailing list a few months back (but I think I was bad and didn''t submit a patch). Anyway, the init script approach works fine for me. Let me know if you can''t find them. On Mon, Mar 31, 2008 at 11:07 AM, Billy Kimble <bkimble at inc21.com> wrote:> Guys, > > I recently installed CruiseControl and I love it. So much that I want > to run it on its own server to handle all of my building needs. I > installed it, added projects, ran it, and everything was groovy. I > decided to stick the process in the background via: > > ./cruise start & > > And it put it in the background just fine too. Everything was kosher > until I tried logging out of my server. CruiseControl seemed to not > want to relinquish control of my SSH connection. I thought perhaps it > was a fluke on my connection so I just forcefully disconnected and > tried triggering CC to build, which failed with the following message: > > [error] Input/output error > [error] ./script/../config/../builder_plugins/installed/ > minimal_console_logger.rb:20:in `write'' > [error] ./script/../config/../builder_plugins/installed/ > minimal_console_logger.rb:20:in `puts'' > [error] ./script/../config/../builder_plugins/installed/ > minimal_console_logger.rb:20:in `new_revisions_detected'' > [error] ./script/../config/../app/models/project.rb:325:in `send'' > [error] ./script/../config/../app/models/project.rb:325:in `notify'' > [error] ./script/../config/../app/models/project.rb:323:in `collect'' > [error] ./script/../config/../app/models/project.rb:323:in `notify'' > [error] ./script/../config/../app/models/project.rb:208:in > `build_if_necessary'' > [error] ./script/../config/../app/models/polling_scheduler.rb:13:in > `run'' > [error] ./script/builder:79 > [error] ./script/builder:78:in `catch'' > [error] ./script/builder:78 > [error] script/../config/../cruise:14:in `load'' > [error] script/../config/../cruise:14:in `builder'' > [error] script/../config/../cruise:68:in `send'' > [error] script/../config/../cruise:68 > [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' > [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' > [error] script/../config/../cruise:67 > [error] Input/output error > [error] ./script/../config/../builder_plugins/installed/ > minimal_console_logger.rb:24:in `write'' > [error] ./script/../config/../builder_plugins/installed/ > minimal_console_logger.rb:24:in `puts'' > [error] ./script/../config/../builder_plugins/installed/ > minimal_console_logger.rb:24:in `build_loop_failed'' > [error] ./script/../config/../app/models/project.rb:325:in `send'' > [error] ./script/../config/../app/models/project.rb:325:in `notify'' > [error] ./script/../config/../app/models/project.rb:323:in `collect'' > [error] ./script/../config/../app/models/project.rb:323:in `notify'' > [error] ./script/../config/../app/models/project.rb:213:in > `build_if_necessary'' > [error] ./script/../config/../app/models/polling_scheduler.rb:13:in > `run'' > [error] ./script/builder:79 > [error] ./script/builder:78:in `catch'' > [error] ./script/builder:78 > [error] script/../config/../cruise:14:in `load'' > [error] script/../config/../cruise:14:in `builder'' > [error] script/../config/../cruise:68:in `send'' > [error] script/../config/../cruise:68 > [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' > [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' > [error] script/../config/../cruise:67 > [error] Input/output error > [error] ./script/../config/../lib/cruise_control/log.rb:35:in `write'' > [error] ./script/../config/../lib/cruise_control/log.rb:35:in `puts'' > [error] ./script/../config/../lib/cruise_control/log.rb:35:in > `method_missing'' > [error] ./script/../config/../app/models/project.rb:327:in `notify'' > [error] ./script/../config/../app/models/project.rb:323:in `collect'' > [error] ./script/../config/../app/models/project.rb:323:in `notify'' > [error] ./script/../config/../app/models/project.rb:208:in > `build_if_necessary'' > [error] ./script/../config/../app/models/polling_scheduler.rb:13:in > `run'' > [error] ./script/builder:79 > [error] ./script/builder:78:in `catch'' > [error] ./script/builder:78 > [error] script/../config/../cruise:14:in `load'' > [error] script/../config/../cruise:14:in `builder'' > [error] script/../config/../cruise:68:in `send'' > [error] script/../config/../cruise:68 > [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' > [error] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' > [error] script/../config/../cruise:67 > [fatal] Input/output error > [fatal] ./script/../config/../app/models/polling_scheduler.rb:62:in > `write'' > [fatal] ./script/../config/../app/models/polling_scheduler.rb:62:in > `puts'' > [fatal] ./script/../config/../app/models/polling_scheduler.rb:62:in > `log_error'' > [fatal] ./script/../config/../app/models/polling_scheduler.rb:17:in > `run'' > [fatal] ./script/builder:79 > [fatal] ./script/builder:78:in `catch'' > [fatal] ./script/builder:78 > [fatal] script/../config/../cruise:14:in `load'' > [fatal] script/../config/../cruise:14:in `builder'' > [fatal] script/../config/../cruise:68:in `send'' > [fatal] script/../config/../cruise:68 > [fatal] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `chdir'' > [fatal] /usr/local/lib/ruby/1.8/fileutils.rb:121:in `cd'' > [fatal] script/../config/../cruise:67 > [info] [2008-03-31 10:59:48] Builder for project ''noaama_trunk'' exited > > It appears that CruiseControl always wants a console to write to. I > thought this was because of WEBRICK so I forced it to start in Daemon > mode. Unfortunately that did not work and I am now at a loss. Is > there something special I need to do to get CruiseControl to build > projects in the background, so I can start it up as a service and let > it do its work? I am running CentOS 5 and Ruby 1.8.6. Any insight > would be greatly appreciated. > > Billy > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > _______________________________________________ > Cruisecontrolrb-users mailing list > Cruisecontrolrb-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users >
here is a copy of my init script, i think i got it from a sample dir somewhere. #!/usr/bin/env ruby # # chkconfig: 345 94 16 # description: Startup script for CruiseControl.rb # in order to make cruise run as daemon, you need: # 1. cp $CCRB_HOME/daemon/cruise.sample $CCRB_HOME/daemon/cruise # 2. specify your cruise_path to $CCRB_HOME in $CCRB_HOME/daemon/cruise file # 3. ln -s $CCRB_HOME/daemon/cruise /etc/init.d/cruise (you may need to ''sudo'' this) # 4. update-rc.d cruise (you may want to choose options by yourself, and you may need to ''sudo'' this) # 5. it''s done :> require "fileutils" include FileUtils require "rubygems" begin gem ''mongrel'' rescue => e puts "Error: daemon mode of CC.rb requires mongrel installed" exit 1 end def cruise_path "/var/www/apps/cruisecontrol" end command = ARGV.shift case command when ''start'' cd cruise_path system "/bin/su -c ''/var/www/apps/cruisecontrol/cruise start -d'' - deploy" exit 0 when ''stop'' system "mongrel_rails stop -P #{cruise_path}/tmp/pids/mongrel.pid" Dir["#{cruise_path}/tmp/pids/builders/*.pid"].each do |pid_file| pid = File.open(pid_file){|f| f.read } system "kill -9 #{pid}" rm pid_file end exit 0 else p "Usage: /etc/init.d/cruise start|stop" exit 1 end
Sorry, I forgot to mention that I did try that. It produces the same connection usurping that has been plaguing me. I tried installing CC on my OSX desktop and it seems to work fine when I start it up in daemon mode. I can safely log out of my terminal connection and CruiseControl goes about its merry way. I am beginning to think this is a server problem. Has anyone run in to trouble using CruiseControl on CentOS 5 ? I am going to try the init script that Nathen and David mentioned / posted to see if running it as a service fixing my problems. This is driving me bonkers! Billy On Mar 31, 2008, at 11:30 AM, Nathen Harvey wrote:> Try this: > > ./cruise start --daemon > > For more info: > ./cruise help start > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > _______________________________________________ > Cruisecontrolrb-users mailing list > Cruisecontrolrb-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cruisecontrolrb-users/attachments/20080331/73856574/attachment.html
Ok, so I Got it working! One glaring difference (that I overlooked) between my workstation and my current build server is that I do not have Mongrel installed on my server. One I did installed Mongrel, everything was working perfectly. The CruiseControl documentation does not mention the Mongrel requirement. Luckily you guys passed the /daemon/cruise.sample file here which had the following comment in it: puts "Error: daemon mode of CC.rb requires mongrel installed" This lead to me installing Mongrel to use the --daemon option. Perhaps a check could be put in to check for mongrel and complain if it is not present when someone starts in --daemon mode .. or at the very least state this in the ''help start'' text :) Thanks guys. I''m cruising now! Billy On Mar 31, 2008, at 12:47 PM, Billy Kimble wrote:> Sorry, I forgot to mention that I did try that. It produces the > same connection usurping that has been plaguing me. > > I tried installing CC on my OSX desktop and it seems to work fine > when I start it up in daemon mode. I can safely log out of my > terminal connection and CruiseControl goes about its merry way. I > am beginning to think this is a server problem. Has anyone run in > to trouble using CruiseControl on CentOS 5 ? I am going to try the > init script that Nathen and David mentioned / posted to see if > running it as a service fixing my problems. This is driving me > bonkers! > > Billy > > On Mar 31, 2008, at 11:30 AM, Nathen Harvey wrote: > >> Try this: >> >> ./cruise start --daemon >> >> For more info: >> ./cruise help start >> >> >> -- >> This message has been scanned for viruses and >> dangerous content by MailScanner, and is >> believed to be clean. >> _______________________________________________ >> Cruisecontrolrb-users mailing list >> Cruisecontrolrb-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > _______________________________________________ > Cruisecontrolrb-users mailing list > Cruisecontrolrb-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cruisecontrolrb-users/attachments/20080331/bd436633/attachment.html
Alexey Verkhovsky
2008-Mar-31 20:54 UTC
[Cruisecontrolrb-users] CruiseControl in Daemon mode?
> The CruiseControl documentation does not mention the Mongrel > requirement.Oops. Thanks for the heads up. As for CentOS 5, for some irrelevant historical reasons, that''s my favorite server Linux. http://cruisecontrolrb.thoughtworks.com runs quite merrily on it. -- Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/cruisecontrolrb-users/attachments/20080331/aac1be2e/attachment.html