我在ubuntu 16上安装了influxdb,由于某种原因,当我尝试在终端中编写时,service influxd
它给了我influxd: unrecognized service.
如果我只输入influxd而不是influxdb服务器正在启动,那么命令influxd已启动
$ which influxd :
$ /usr/bin/influxd
我要做的是使它像服务一样工作,因此我可以按需启动和停止它,并使其在启动时自动启动
尝试建立到/etc/init.d文件夹的符号链接也不起作用。
您可以通过添加呼叫来解决此问题,/etc/rc.local
以使文件内容如下所示:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
Examples (use only one, you might need to try which one will work):
# option 1. direct call
/usr/bin/influxd
# option 2. call it from init.d but I'm not sure this will work in your case
/etc/init.d/influxd start
exit 0
正如评论中指出的那样,使用Ubuntu 16.04 LTS,您还可以查看systemd
服务。我无法像链接的文档表中那样更好地解释它,所以我仅将其保留为链接。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句