5

I have installed Microsoft SQL-Server on my ubuntu machine. Now it works fine, but every time I shutdown the machine, shutdown halts at

A stop job is running for microsoft sql server database engine ( x/30min )

Now if you wait 30 minutes, then it shuts off, so technically, it's not a bug. However, when I have to shut off the laptop I don't have time to wait 30 minutes ... Also, I sometimes have to restart the machine, and don't want to have to wait 30 minutes to restart it...

Is there any way to block or disable this stop-job? Where are stop-jobs configured?

WitchCraft
  • 1,904

1 Answers1

6

Tried sudo dpkg-reconfigure tzdata, but that didn't help.
What helps is the following:

Open /lib/systemd/system/mssql-server.service with a text-editor
and change TimeoutSec=30min to TimeoutSec=5sec

Then run

systemctl daemon-reload

to reload the configuration.

That's it, the timeout is now 5 seconds instead of 30 minutes.

For risks and side effects, read the package leaflet and ask your doctor or pharmacist - and keep a backup handy at all times.
You should do that anyway.

For more information: RTFM / man page

Note:
As per PerlDuck's tipp, instead of directly editing /lib/systemd/system/mssql-server.service, you should sudo systemctl edit mssql-server.service to create a drop-in that does not get overwritten when mssql is updated.

The file /etc/systemd/system/mssql-server.service.d/override.conf should only contain the values it overrides, e.g.

[Service]
TimeoutSec=5sec
WitchCraft
  • 1,904