如何将服务 mssql-server 设置为在启动时启动
root@ubuntu-s-1vcpu-2gb-lon1-01:/etc/init.d# update-rc.d mssql-server enable
update-rc.d: error: cannot find a LSB script for mssql-server
root@ubuntu-s-1vcpu-2gb-lon1-01:/etc/init.d# update-rc.d system.ctl mssql-server enable
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
-n: not really
-f: force
The disable|enable API is not stable and might change in the future.
root@ubuntu-s-1vcpu-2gb-lon1-01:/etc/init.d# update-rc.d system.ctl mssql-server -f
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
-n: not really
-f: force
答案1
如果您使用的是 Ubuntu 16.04,如问题标签中所述,则应改用 systemctl。要在启动时启用该服务:
systemctl enable mssql
要在启动时禁用该服务:
systemctl disable mssql
也许服务名称是 mssql-server,因此先尝试使用 mysql,然后尝试使用 mysqld