[英]Unable to use service command with debian 8 (Jessie)
为了将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发行说明:
当系统询问您是否应将/etc/init.d目录中的任何文件或/etc/manpath.config文件替换为软件包维护者的版本时,通常需要回答“是”以确保系统一致性
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.