在操作系统启动时是否有一种简单的启动Fuseki的方法,或多或少像我们可以从 /etc/init.d/tomcat7 start 或 /启动Tomcat或ElasticSearch实例etc / init.d / elasticsearch start ?
据我所知,Fuseki似乎没有状态方法,而且它似乎没有类似于 / etc /的东西init.d / 技巧。
答案 0 :(得分:6)
实际上,Fuseki附带了一个脚本,可以完全满足您的要求。我想,这只是将 fuseki 脚本放在 init.d 目录中。分发中的 fuseki 脚本采用 {start | stop | restart | status} 参数。以下是命令行中使用的内容:
$ ./fuseki
Usage: fuseki {start|stop|restart|status}
$ ./fuseki status
Fuseki is not running
$ ./fuseki start
Starting Fuseki: Redirecting Fuseki stderr/stdout to .../jena-fuseki-1.1.2-SNAPSHOT/log/stderrout.log
STARTED Fuseki Mon Oct 27 10:02:59 EDT 2014
PID=3752
$ ./fuseki status
Fuseki is running with pid: 3752
$ ./fuseki restart
Stopping Fuseki: OK
Starting Fuseki: Redirecting Fuseki stderr/stdout to .../jena-fuseki-1.1.2-SNAPSHOT/log/stderrout.log
STARTED Fuseki Mon Oct 27 10:03:09 EDT 2014
PID=3813
$ ./fuseki status
Fuseki is running with pid: 3813
$ ./fuseki stop
Stopping Fuseki: OK
$ ./fuseki status
Fuseki is not running
它实际上是为此目的而设计的;看看我们看到的来源:
# Startup script for Fuseki under *nix systems (works with cygwin too)
#
# Configuration
# -------------
# Default values are loaded from /etc/default/fuseki, if it exists.
⋮
# FUSEKI_HOME
# Where Fuseki is installed. If not set, the script will try
# to guess it based on the script invokation path.
#
# FUSEKI_RUN
# Where the fuseki.pid file should be stored. It defaults
# first available of /var/run, /usr/var/run, and /tmp if not set.
#
# FUSEKI_PID
# The FUSEKI PID file, defaults to $FUSEKI_RUN/fuseki.pid
#
# FUSEKI_ARGS
# The arguments to pass to the Fuseki server on the command line. Defaults to:
# --update --loc=$FUSKEI_DATA_DIR /ds # if FUSEKI_CONF is not set
# --config=$FUSEKI_CONF # if FUSEKI_CONF is set
#
# FUSEKI_CONF
# The Fuseki configuration file, usually in RDF Turtle notation.
#
# FUSEKI_USER
# If set, the server will be run as this user
#
# FUSEKI_DATA_DIR
# The location of the data directory Fuseki will use (i.e. the value of --loc).
# Defaults to $FUSEKI_HOME/DB
#
# FUSEKI_LOGS
# Directory where logs will be generated. Defaults to $FUSEKI_HOME/log
#
# FUSEKI_LOGS_STDERROUT
# Log file with stderr and stdout log output from Fuseki. Defaults to
# $FUSEKI_LOGS/stderrout.log