automatically start services in templates

cle.ram

New Member
Jun 15, 2009
17
0
1
I creates a proxmox-template with openerp-server using dab. When I create a virtual machine and start it, the service (OpenERP-Server) is not started automatically (but the rc-scripts are there). So I have to issue a /etc/init.d/SERVICENAME start.
Furthermore the virtual machine does not request an IP-adress, so I have to do that manually via dhclient, too.

Did I miss something in the sample appliances? I didn't find a way to automate those processes.

The template I created is based on debian-lenny and I configured the VMs to use bridged ethernet.

TIA
clemens
 
Last edited:
I creates a proxmox-template with openerp-server using dab. When I create a virtual machine and start it, the service (OpenERP-Server) is not started automatically (but the rc-scripts are there). So I have to issue a /etc/init.d/SERVICENAME start.
Furthermore the virtual machine does not request an IP-adress, so I have to do that manually via dhclient, too.

Did I miss something in the sample appliances? I didn't find a way to automate those processes.

The template I created is based on debian-lenny and I configured the VMs to use bridged ethernet.

TIA
clemens

pls post your dab config/make files and we can see whats wrong.
 
dab.conf:
Code:
Suite: lenny
CacheDir: ../cache
Source: http://ftp.debian.org/debian SUITE main contrib
Source: http://security.debian.org SUITE/updates main contrib
Source: http://[B][COLOR=Green]Open-ERP-Testrepository[/COLOR][/B]
Architecture: i386
Name: openbig-debian-openerp
Version: 1.0
Section: system
Maintainer: 
Infopage:
Description: Debian OpenERP-Server Appliance
 Only for testing
I did not create a make-script... instead I did the following inside the dab-template directory:
Code:
dab init
dab bootstrap --minimal
dab install emacs
dab install python python-psycopg2 python-reportlab python-pychart python-pydot python-egenix-mxdatetime python-xml python-lxml python-libxslt1 python-tz python-imaging python-vobject 
dab task postgres
dab task postgres --start
dab install openbig-openerp-server
dab install openssh-server openssh-client
dab exec /etc/init.d/openerp-server-daemon stop
dab finalize
In fact, the error occours without "dab exec /etc/init.d/openerp-server-daemon stop", too.

Thanks for your help!
 
Creating a template does not start any services normally (that is not required). You need to finish template building before you start your template. Also, please use a makefile - as pointed out in the examples.
 
I issued the "dab exec /etc/init.d/openerp-server-daemon stop" only because the services was started inside the template-vm by the installation routines of the package "openbig-openerp-server".
Reading the basic tutorial in http://pve.proxmox.com/wiki/Debian_Appliance_Builder, I thought "dab finalize" finished the template-building. After that I copied the .tar.gz to /var/lib/vz/template/cache/ of proxmox-ve and started a VM using the template via the webinterface. In the new VM I got the mentioned issues.

I'll try to write a makefile, now...
 
Last edited:
I thought "dab finalize" finished the template-building.

Yes, that is true. I am confused about when you get that error. The script you posted contains 'dab finalize' as last command, so I assumed the error occured earlier?
 
No, I'm unhappy with the resulting VMs ;). The template creation process works without issues.
 
finally here is my Makefile:
Code:
BASEDIR:=$(shell dab basedir)

all: info/init_ok
    dab bootstrap
    dab task postgres
    dab task postgres --start
    dab install emacs python python-psycopg2 python-reportlab python-pychart python-pydot python-egenix-mxdatetime python-xml python-lxml python-libxslt1 python-tz python-imaging python-vobject openssh-server openssh-client
    dab install openbig-openerp-server
    dab finalize

info/init_ok: dab.conf
    dab init
    touch $@

.PHONY: clean
clean:
    dab clean
    rm -f *~

.PHONY: dist-clean
dist-clean:
    dab dist-clean
    rm -f *~
...The problems are the same when I create and start a VM: no dhcp-request and the service "openerp-server-daemon" is not running
 
I cant help/test, because I do not have access to 'http://Open-ERP-Testrepository'

- Dietmar
 
I resolved the dhcp-issue by adding
Code:
dab exec 'echo "auto eth0" >> /etc/network/interfaces'
dab exec 'echo "iface eth0 inet dhcp" >> /etc/network/interfaces'
to the Makefile. The machine now gets an ip address. The idea is that the created VM does everything automatically and no more user-inventions are needed.
But it's strange that the IP doesn't show up in Proxmox' Status Page of the VM ("IP Address:unknown").

I discovered weird things related to the openerp-service. Actually it is started when the VM boots - but then it instantly vanishes. The openerp-server.log does not say that it was killed (instead it says only that the service successfully started). But the process just isnt there anymore...
 
Last edited:
I discovered weird things related to the openerp-service. Actually it is started when the VM boots - but then it instantly vanishes. The openerp-server.log does not say that it was killed (instead it says only that the service successfully started). But the process just isnt there anymore...

Simply try to debug that inside the container - using strace or other debugging tools.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!