I am reading the book Ubuntu Server Book 2nd Edition. It states the following:
At the moment, Upstart does replace the functionality of init and the /etc/inittab file and manages changes to run- levels, system start-up and shutdown, console ttys, and more and more core functionality is being ported to Upstart scripts
My take from this is that upstart handles starting up scripts on run-levels. So if run-level 2 was entered, it will be Upstart and not System V that starts the script, which in turn starts the executable program.
So I have installed postgresql from the repositories. And indeed when system starts up, the postgres daemon runs in the background. Obviously if System V didn't do this, then it must have been Upstart that performed this task. But when I go to /etc/init, which is where all the upstart scripts reside, there is no reference to postgresql anywhere. However, when I go to /etc/rc1.d, which is where run-level 1 scripts reside, I indeed find a postgresql script:
$ ls -l | grep postgresql lrwxrwxrwx 1 root root 20 Jun 1 11:10 K21postgresql -> ../init.d/postgresql
So why is there no upstart script for postgresql and without an upstart script, how is postgresql starting up?