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

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

nutshi gravatar image

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

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 :-

 - [ 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

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

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

killingwolf gravatar image

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

edit flag offensive delete link more

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

Praveen N gravatar image


This link may help you

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-02-26 15:20:07 -0600

Seen: 276 times

Last updated: Mar 17 '15