Ask Your Question
0

Heat run user-data before create user

asked 2014-07-18 09:51:09 -0500

HoangDo gravatar image

Hello everyone,

I'm trying to run HOT chefserver script and I got this error:

Expected process to exit with [0], but received '1'
---- Begin output of bin/bootstrap-chef-server ----
STDOUT:
STDERR: erlexec: HOME must be set
---- End output of bin/bootstrap-chef-server ----

But when I log in to the VM, the HOME was already set:

echo $HOME
/home/ec2-user

I guessed this error happens because user-data was run before ec2-user created. I used Ubuntu image, it auto-create ec2-user

Is my guess true? How can I solve this problem?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-07-25 09:49:46 -0500

Eric GH gravatar image

updated 2014-07-25 10:20:01 -0500

I believe you are right. see below /etc/rc.d/rc5.d/

lrwxrwxrwx. 1 root root 26 Mar  4 21:15 S50cloud-init-local -> ../init.d/cloud-init-local
lrwxrwxrwx. 1 root root 20 Mar  4 21:15 S51cloud-init -> ../init.d/cloud-init
lrwxrwxrwx. 1 root root 22 Mar  4 21:15 S52cloud-config -> ../init.d/cloud-config
lrwxrwxrwx. 1 root root 21 Mar  4 21:15 S53cloud-final -> ../init.d/cloud-final
lrwxrwxrwx. 1 root root 14 Feb 25 12:00 S55sshd -> ../init.d/sshd

The cloud-init process is at 50-53 step in the boot sequence.

And one workaround for this case is to manually create user before other content in the user-data

edit flag offensive delete link more

Comments

Seems like I have to workaround like you said.

By the way, I'm quite confuse about this: If I launch Ubuntu instance by nova, it only created an ubuntu user (default user). But if I launch the same image by Heat, it created an ec2-user user (instead of ubuntu). Do you have any idea about it?

HoangDo gravatar imageHoangDo ( 2014-07-29 03:06:59 -0500 )edit

Not sure if you run the nova command with the userdata option. You might like see more here

http://docs.openstack.org/user-guide/...

I thought the 'ubuntu' user is built in the default image. and ec2-user is the user to when manipulate the cloudinit/userdata.

Eric GH gravatar imageEric GH ( 2014-07-29 08:34:22 -0500 )edit

The ec2-user user is created by cloud-init.

zaneb gravatar imagezaneb ( 2014-08-04 12:00:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-07-18 09:51:09 -0500

Seen: 769 times

Last updated: Jul 25 '14