为了将 LibreOffice 4.4 安装到我的 Debian 8 (Jessie) 中,我刚刚从我的 Debian 7.5 中获取了所有 bash 脚本,并以相同的方式将它们运行到 D8 中。
我知道新版本有一些变化,但我不能再像这样使用我的服务了:
sudo service libreoffice start
这样做不会启动任何东西,我必须使用 :
sudo /etc/init.d/libreoffice start
奇怪的是,在做的时候(错误的参数):
sudo service libreoffice dzedjiodjzedj
...脚本已完美执行并显示了我捕获的错误
这是我的/etc/init.d/libreoffice 文件:
#
# libreoffice This shell script takes care of starting and stopping the LibreOffice Daemon
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: libreofficedaemon
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Init.d script to run a LibreOffice Daemon
# Short-Description: start and stop LibreOffice Daemon
### END INIT INFO
NAME="LibreOffice Service"
LIBREOFFICE_HOME=/opt/libreoffice4.4
LIBREOFFICE_USER=libreoffice
export LIBREOFFICE_HOME LIBREOFFICE_USER
start() {
echo -ne "Starting $NAME. \n"
su $LIBREOFFICE_USER -c "$LIBREOFFICE_HOME/start.sh"
}
stop() {
echo -ne "Stopping $NAME. \n"
su $LIBREOFFICE_USER -c "$LIBREOFFICE_HOME/stop.sh"
}
kill() {
echo -ne "Force close of $NAME. "
killall -u $LIBREOFFICE_USER
}
cd $LIBREOFFICE_HOME
case "$1" in
start|stop)
$1;;
restart) stop; start;;
kill) kill;;
*)
echo "Usage: /etc/init.d/libreoffice {start|stop|restart|kill}"
exit 1
;;
esac
exit 0
我昨天刚刚用 tomcat8 服务运行了那个问题,我只是手动启动了该服务,sudo service tomcat8 start
在那之后起作用了,但 libreoffice 没有任何作用..
来自 Debian Jessie 发行说明:
When you are asked if any file in the /etc/init.d directory, or the /etc/manpath.config file should be replaced by the package maintainer's version, it's usually necessary to answer “yes” to ensure system consistency
最佳答案
关于linux - 无法在 debian 8 中使用服务命令 (Jessie),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30345399/