Run Script when container reboots

bobdobelina

New Member
Dec 5, 2011
8
0
1
Hi,

I have successfully got asterisk PBX (Elastix, PiAF) working in proxmox environment with dahdi timing module working to allow conference call on the vps. To get conference calls working on the vps it requires access to the master where dahdi is running. This is achieved by running the following script on the master after creating vps:

clear
echo "This script enables call conferencing in Elastix on Proxmox"
echo "please enter the VE number"
read VENUMBER
vzctl set $VENUMBER --devnodes dahdi/channel:rw --save
vzctl set $VENUMBER --devnodes dahdi/ctl:rw --save
vzctl set $VENUMBER --devnodes dahdi/timer:rw --save
vzctl set $VENUMBER --devnodes dahdi/pseudo:rw --save
vzctl set $VENUMBER --devnodes null:rw --save


echo "Job Done - Now reload asterisk in VE-"$VENUMBER

I have a problem being that every time the vps is reloaded this script requires running again. Can anyone point me in the right direction to get Proxmox running the script automatically when vps is rebooted? This would also require the script to identify the $VENUMBER and insert it automatically prior to running.

Thanks
Bob
 
After some further research i have read about openvz action scripts. I believe i require the functions of the start action script only i require the script to run on the host node when the vps starts and not within the coontainer. Anybody have a working method of doing this?

Thanks
 

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!