pct exec and daemonizing

Nov 17, 2017
16
0
6
59
I wish to launch a script on a collection of containers. pct exec seems to do what I want. Except I want to background my script and have the pct exec finish immediately. I tried just adding an & (ampersand) but when the pct exec finishes, it terminates the backgrounded script. I have now tried with the daemonize utility from http://software.clapper.org/daemonize/ and still my scripts seem to be terminated as soon as pct exec finishes. There is very little documentation I can find on precisely what/how pct exec works - and, in particular, what are the implications on spawned processes when the exec returns control flow back to the host. Any pointers would be appreciated.
 
Please use ssh for such things. That way, started script belong to the container and works as expected.
Maybe together with some automation toolkit like ansible.
 
An ssh approach does work. It would be nice if the pct documentation included something like "pct exec has restrictions compared to, say, an ssh approach. Notably, the execution environment in the container ceases to exist when pct exits."
 

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!