yesod ap, upstart problems

47 views
Skip to first unread message

Anton Cheshkov

unread,
May 3, 2012, 8:02:47 AM5/3/12
to yeso...@googlegroups.com
Hello,

i use script bellow to monitor my application

description "My awesome Yesod application" start on runlevel [2345]; stop on runlevel [!2345]; respawn chdir /home/michael/sites/mysite exec /home/michael/sites/mysite/dist/build/mysite/mysite 


i gщt follow error when my application being started with "upstart" 


HOME: getHomeDirectory: does not exist (no environment variable)


All works fine without upstart. 

Thanks.

--
Best regards,
Cheshkov Anton

Kirill Zaborsky

unread,
May 3, 2012, 8:21:08 AM5/3/12
to yeso...@googlegroups.com
Which upstart do you use?
I hade somewhat similar problems (actually locale was not set) and the problem was with upstart to setting up proper environment (so LC_ALL happened to be equal to C).
I think 'setuid' stanza could help but it was not available for Ubuntu Lucid.
I moved from upstart (currently we use pacemaker + classic initscripts with start-stop-daemon) so I do not guarantee that 'setuid' will help you.

Kind regards,
Kirill Zaborsky

2012/5/3 Anton Cheshkov <ache...@gmail.com>

Michael Snoyman

unread,
May 3, 2012, 8:24:10 AM5/3/12
to yeso...@googlegroups.com
Do you actually have a folder /home/michael/sites/mysite? That seems
like the kind of folder only people named Michael would have...

Anton Cheshkov

unread,
May 3, 2012, 8:51:23 AM5/3/12
to yeso...@googlegroups.com
I have coppied template from your book, i have my own names of course. 

2012/5/3 Michael Snoyman <mic...@snoyman.com>
Phone: +7 909 005 18 82
Skype: cheshkov_anton

Anton Cheshkov

unread,
May 3, 2012, 9:11:07 AM5/3/12
to yeso...@googlegroups.com
Hello Kirill, 

My upstart version is 1.5. Thanks for advice,  I've tried to use 'setuid', unfortunatly it did not get result. 



2012/5/3 Kirill Zaborsky <qri...@gmail.com>

Felipe Almeida Lessa

unread,
May 3, 2012, 9:16:06 AM5/3/12
to yeso...@googlegroups.com
What I find interesting in this problem is that yesod or wai
themselves don't use getHomeDirectory AFAIK. Perhaps that's why
nobody ever stumbled upon this.

Are you using getHomeDirectory yourself? Or do you know of any other
library that you're using that needs it?

You may try manually setting $HOME using a stanza (cf.
http://upstart.ubuntu.com/wiki/Stanzas#env).

Cheers,

--
Felipe.

Anton Cheshkov

unread,
May 3, 2012, 9:25:46 AM5/3/12
to yeso...@googlegroups.com
 Yes i use aws[1] library, it would use routines to obtain home directory. 

env 'stanza' sets local variables in current scrtipt, it's not possible to setup $HOME system variable this way.

[1]  http://hackage.haskell.org/package/aws 

2012/5/3 Felipe Almeida Lessa <felipe...@gmail.com>

--
Best regards,
Cheshkov Anton

Felipe Almeida Lessa

unread,
May 3, 2012, 9:29:32 AM5/3/12
to yeso...@googlegroups.com
On Thu, May 3, 2012 at 10:25 AM, Anton Cheshkov <ache...@gmail.com> wrote:
>  Yes i use aws[1] library, it would use routines to obtain home directory.

You may try loading the credentials and setting up the Configuration
manually (that's what I do).

> env 'stanza' sets local variables in current scrtipt, it's not possible to
> setup $HOME system variable this way.

Have you tried? I don't see why it wouldn't work. AFAICS they're all
environment variables, not local/system variables.

Cheers,

--
Felipe.

Anton Cheshkov

unread,
May 3, 2012, 9:35:56 AM5/3/12
to yeso...@googlegroups.com
Thanks Felipe, 

i will try. 

i think i've already have enough information to getting it done. 

Thanks All ;)

2012/5/3 Felipe Almeida Lessa <felipe...@gmail.com>
On Thu, May 3, 2012 at 10:25 AM, Anton Cheshkov <ache...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages