DB2 Instance autostart does not work on SLES 12 / RHEL 7

I had to fight with a customer environment on SLES 12 where the db2 instances did not start automatically when starting the operation system.

db2iauto -on db2inst1

was executed but the instance did not come up! The problem is related to the DB2 fault monitor that is not started automatically on system start.
The fault monitor permanently monitors the instance and automatically restarts it after a crash. Furthermore, the fault monitor can auto restart an instance on machine reboot. If you issue „db2stop“ then the fault monitor will NOT start the instance automatically again – but this is the only exception.
In total a good mechanism – but useless when using TSAMP / HACMP Cluster Software because in this case the restart of an instance is controlled by this kind of software.

On pre SLES 12 / RHEL 7 systems the fault monitor is started using inittab:

The entry was available on this system…
But on SLES 12 / RHEL 7 systemd replaces the default init system. This entry in inittab is not executed anymore.

You need to configure a service for the fault monitor be to started when the operating system starts – IBM already created a technote for this:

This tells the systemd daemon to start the db2 fault monitor on system start. Furthermore „Restart=always“ tells the daemon to restart the service if it terminates abnormally.

3) execute the following command to refresh the configuration

systemctl daemon-reload

4) execute the following command to enable the service

systemctl enable db2fmcd

5) execute the following command to start the service

systemctl start db2fmcd

Now you need to login as your instance owner and set the instance to automatically start upon operating system start

db2iauto -on db2inst1

Check the setting using
db2set:

Restart the operating system to check if your change was successful.

If you want to start your application / HTTP servers automatically on operating system start you should also use systemd – once you understood the concept behind it is a powerful and better init system than the old one from the previous SLES / RHEL versions.