I have entry in grub to start my configuration script written in Python. I would like to give user option to start normal session after the work is done. But I've found that /sbin/init needs to have PID==1, so when I run in Python:
#!/usr/bin/python
...
import subprocess
subprocess.call(["/bin/bash", "-c", "exec /sbin/init 2"])
#subprocess.call("exec /sbin/init 2", shell=True)
-it ends with:
init: Failed to connect to socket /com/ubuntu/upstart: Connection refused
and kernel panic
Is there any solution for this?