Ramon Miguel M. Tayag
2008-Sep-21 10:23 UTC
[Backgroundrb-devel] Monit; BackgroundRB; environment variables
I started emailing monit mailing list because I started getting this problem where I couldn''t start backgroundrb with monit anymore, thinking it was a monit problem. However, I back tracked a bit since I had added code to my project, and monit was able to start backgroundrb again. I seem to have zeroed in on the problem. I''m not sure where the problem lies - maybe monit or maybe backgroundrb, or very likely, my code :) The problem of monit not being able to start backgroundrb started when I added 2 lines to my Rails configuration file: "require ''lib/hodel_3000_compliant_logger''" AND "config.logger Hodel3000CompliantLogger.new(config.log_path)" (See http://pastie.org/276618 for better formatting. I had just installed a logger tool.) My speculation: via monit backgroundrb tried to load the logger lib but can''t find it. Since monit does away with environment variables, maybe the backgroundrb script expects some of these to be there (maybe to find where the RAILS_ROOT is). I''m stuck because I don''t know what environment variables the backgroundrb script needs to start properly. If I know what it needs then I can add it to the monit start command. Thanks, -- Ramon Tayag
hemant kumar
2008-Sep-21 19:25 UTC
[Backgroundrb-devel] Monit; BackgroundRB; environment variables
BackgrounDRb doesn''t depends on any environment variable, but it depends on correct path (meaning, location from where you are starting backgroundrb matters. On Sun, 2008-09-21 at 18:23 +0800, Ramon Miguel M. Tayag wrote:> I started emailing monit mailing list because I started getting this > problem where I couldn''t start backgroundrb with monit anymore, > thinking it was a monit problem. However, I back tracked a bit since > I had added code to my project, and monit was able to start > backgroundrb again. > > I seem to have zeroed in on the problem. I''m not sure where the > problem lies - maybe monit or maybe backgroundrb, or very likely, my > code :) > > The problem of monit not being able to start backgroundrb started when > I added 2 lines to my Rails configuration file: > > "require ''lib/hodel_3000_compliant_logger''" AND "config.logger > Hodel3000CompliantLogger.new(config.log_path)" > (See http://pastie.org/276618 for better formatting. I had just > installed a logger tool.) > > My speculation: via monit backgroundrb tried to load the logger lib > but can''t find it. Since monit does away with environment variables, > maybe the backgroundrb script expects some of these to be there (maybe > to find where the RAILS_ROOT is). > > I''m stuck because I don''t know what environment variables the > backgroundrb script needs to start properly. If I know what it needs > then I can add it to the monit start command. > > Thanks,
Tim Glen
2008-Sep-22 13:14 UTC
[Backgroundrb-devel] Monit; BackgroundRB; environment variables
Are you saying that instead of calling: `/path/to/my/app/script/backgroundrb start` from a monit script, I should be calling: `cd /path/to/my/app && script/backgroundrb start` ? Should it make any difference? if it actually does, that could be the cause of one of my problems... On 21-Sep-08, at 3:25 PM, hemant kumar wrote:> BackgrounDRb doesn''t depends on any environment variable, but it > depends > on correct path (meaning, location from where you are starting > backgroundrb matters. > > On Sun, 2008-09-21 at 18:23 +0800, Ramon Miguel M. Tayag wrote: >> I started emailing monit mailing list because I started getting this >> problem where I couldn''t start backgroundrb with monit anymore, >> thinking it was a monit problem. However, I back tracked a bit since >> I had added code to my project, and monit was able to start >> backgroundrb again. >> >> I seem to have zeroed in on the problem. I''m not sure where the >> problem lies - maybe monit or maybe backgroundrb, or very likely, my >> code :) >> >> The problem of monit not being able to start backgroundrb started >> when >> I added 2 lines to my Rails configuration file: >> >> "require ''lib/hodel_3000_compliant_logger''" AND "config.logger >> Hodel3000CompliantLogger.new(config.log_path)" >> (See http://pastie.org/276618 for better formatting. I had just >> installed a logger tool.) >> >> My speculation: via monit backgroundrb tried to load the logger lib >> but can''t find it. Since monit does away with environment variables, >> maybe the backgroundrb script expects some of these to be there >> (maybe >> to find where the RAILS_ROOT is). >> >> I''m stuck because I don''t know what environment variables the >> backgroundrb script needs to start properly. If I know what it needs >> then I can add it to the monit start command. >> >> Thanks, > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
hemant
2008-Sep-22 19:58 UTC
[Backgroundrb-devel] Monit; BackgroundRB; environment variables
On Mon, Sep 22, 2008 at 6:44 PM, Tim Glen <tim at pivotib.com> wrote:> Are you saying that instead of calling: > `/path/to/my/app/script/backgroundrb start` > from a monit script, I should be calling: > `cd /path/to/my/app && script/backgroundrb start` ? > > Should it make any difference? if it actually does, that could be the cause > of one of my problems...No that won''t make a difference (usually), but from my experience, monit screws up paths badly, if say for instance, you use relative paths to start your backgroundrb server (or any daemon basically), hence usually I specify full path whenever adding daemons to monitor in monit. When backgroundrb server is starting, it expects, File.join(File.dirname(__FILE__) + "..") to be RAILS_ROOT, thats the only fundamental constant it expects to be correct. All the [other] environment variables(that bdrb needs) it sets itself during startup. Another thing to keep in mind is, "packet_worker_runner" executable should be in PATH, when you are using monit. For interactive shells, its usually in path, but in some cases, when gems binaries are installed in non standard location (or location thats not in PATH), can cause problems.