I needed to make a new image and opted for the new 16.04 ubuntu so I could get newer versions of some packages and not install from source. So far, I regret that decision as online docs are sparse.
With 12.04 and 14.04, I was often able to re-purpose the startup scripts for custom compilations by installing a package, then removeing (not purging) it, to create the ubuntu startup scripts. Then I could just edit them to point to the right config file and binary.
For example, to use the latest openresty I could just do this:
apt-get install nginx apt-get remove nginx
Then I could just update the
/etc/init.d/nginx script to point to my custom binary/config file and I have a happy ubuntu startup script. Great!
This method doesn't work with 16.04 anymore.
ubuntu never pulls my binary (which is in
/usr/local/openresty/nginx/sbin/nginx). it always runs
/sbin/nginx on bootup (i missed uninstalling 'nginx-core' at first) or nothing at all. The same holds true for other packages.
Ubuntu's docs on the transition from upstart are lacking in this area, they're concerned with "start stop".
I have no idea where ubuntu is deciding this. i can't find any config files that point to
/sbin/nginx. No logs help. Every potential file I've come across points to the alternate binary and config.
If anyone can share a good resource on using the new launch system and where it looks/store info, I would be incredibly grateful.
There seems to be a database involved, as it's detected file-changes and asked me to reload -- but I haven't found it.
after toying around a lot, I figured the following out:
It seems that the nginx package installed two types of setups but only uses one. some issues were tied to that.
from trial and error:
systemctl disable nginx.service to disable/delete most links and files
* remove file in /etc/systemd/system/nginx.service if it exists
* place a new file in /lib/systemd/system/nginx.service
systemctl enable nginx.service
the file in /lib/systemd/system/nginx.service must be a file; it can't be symlink (otherwise a too many symlinks error appears)
this seems to work for now. i wish i could use symlinks as these files are tied to version control.