Hi

On 7 February 2013 09:12, Omer Iqbal <momeriqb...@gmail.com> wrote:
> Hey, I used a similar upstart script which works fine for ring.
> However, weirdly enough, my auth with a mysql database fails. I'm using
> korma to interface with the db. The problem only occurs with upstart
> script,, because it works fine when I run it myself.
> To be clearer. When I run: lein trampoline run/lein ring server, my db
> connects fine.
> However, I use the following upstart script:
>
> start on startup
> start on runlevel [2345]
> stop on runlevel [!2345]
> chdir /home/ubuntu/www
> setuid ubuntu
> exec lein trampoline run > out.log 2>&1
>
> When I run the daemon, ring runs fine. However, when it communicates with
> the mysql server, it throw the following exception (amongst a sea of stack
> traces): "java.sql.SQLException: Access denied for user 'root'@'localhost'
> (using password: NO)"
>
> This is weird because my korma config does supply a password, and it works
> fine when I run lein run myself. However for reference sake, I check for an
> environment variable(CLJ_ENV) to decide which config to use. SInce the only
> differentiating factor is upstart, my assumption is that the problem is due
> to setuid. But to be honest, I have no idea what's going wrong.

See this:

http://upstart.ubuntu.com/cookbook/#environment-variables

In particular this part:

"Note that a Job Configuration File does not have access to a user's
environment variables, not even the superuser. This is not possible
since all job processes created are children of init which does not
have a user's environment."

I suspect that has something to do with the problem.

> Oh, and for clarification this is all on an aws machine running Ubuntu
> Server 12.04 LTS.
> Any ideas on whats going on?


-- 
Michael Wood <esiot...@gmail.com>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to