Ask Your Question
1

How to run a service on vm when its bootstapped from cloud init

asked 2015-02-26 15:20:07 -0500

nutshi gravatar image

updated 2015-02-26 15:20:25 -0500

0 down vote favorite

I am trying to run zabbix agent when my vm comes up

my cloudinit.txt (part of it) loks like this :-

runcmd:
 - [ ls, -l, / ]
 - [ ls, -l, /usr ] 
 - [ sudo service zabbix-agent restart ]

most of the commands work ( I am able to list the directory) but the service does not start and i get this in logs:-

sudo service zabbix-agent restart: command not found

If I log into ,y vm ..i am able to start it using the same command

http://stackoverflow.com/questions/28...

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-03-01 20:36:29 -0500

killingwolf gravatar image

I thank you should use the absolute path of the service command.

edit flag offensive delete link more
0

answered 2015-03-17 02:46:05 -0500

Praveen N gravatar image

Hi,

This link may help you http://cloudinit.readthedocs.org/en/l...

edit flag offensive delete link more

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: 2015-02-26 15:20:07 -0500

Seen: 215 times

Last updated: Mar 17 '15